Today we had an interesting exploration into the many ways available in the Oracle Service Bus to load a piece of XML into a variable in a message flow – to use as the source for populating part of a to-be-forwarded request message to the business service or for enriching the response message. Even such a seemingly straightforward task turned out to have a number of ways to approach, each with their own merits and complexities.
The various approaches we uncovered in a space of ten minutes or so:
use a static expression in an Assign action, simply copying the XML content into the variable
use the function fn:doc that can load XML from a local file and assign the XML to a variable that way
introduce the file adapter to load the XML file from the local file system and assign it to a variable; this would also support non-XML formats – like comma separated values – that can be converted to XML
use the database adapter (or the fn-bea:execute-sql) to retrieve the XML content from a relational database
store the XML content in an XQuery transformation
do any of the above and wrap it inside a Proxy Service that can be invoked from from other services, potentially governed by the service More >