Using variable structures in Oracle Service Bus

17 Feb

Recently at a customer one of the Oracle Service Bus developers complained to me that using Xpath mappings in the OSB can be quite complex. The reason of the remark was that with the Assign action custom variables were set and later in the service the OEPE graphical mapper only shows the default $body, $header, etc variables. However the Oracle Service Bus IDE allows the definition of custom variables.

First in this example we use the Assign action to create our own variable $body_original which in this example is just acopy of the original received $body message.


After this we select the Variables section on one of our actions in the stage we need to map the $body_original message. Click on the Add button and a pop-up should appear. The structure label is nothing more then some sort of “group” where the variable will be stored. The Structure Path however is used to define the variabel name you assigned earlier and on runtime will be stored in memory. In this example we used $body_original.


The result should then look like something here below. The new variable is known in the OEPE IDE and the structure of the XML message is shown.


When we look at a Replace, Assign or any other action we now have the chance to easily map with the custom variable $body_original. In our example not a big deal since the XPath statement is very simple, but when using very big and complex XSD (for instance with imports) this is very handy since it prevents you from making namespace or XPath mistakes.



  • Variable structures defined in your IDE will only be visible for the actions within that specific Stage.
  • Variable structures define the structure of the variable (in this example the XML structure) but do NOT define the variable itself.




Posted by on 17-02-2014 in Oracle, OSB


Tags: ,

3 responses to “Using variable structures in Oracle Service Bus

  1. Roger

    17-02-2014 at 18:49

    Nice and clear Blog item !

  2. Barbara

    23-02-2014 at 21:26

    Very helpful, I had a bit of trouble doing this on my own.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: