Transformation of String to XML or XML to String Oracle OSB

Recently we stuck while doing transformation of String to XML using XQuery in OSB. We can any how achieve it via XQuery but here I am sharing our simplest way to do that.

Consider the scenario where you get input in String format in message flow of proxy and you want to convert it into XML format. This we can achieve using Xquery function fn-bea:inlinedXML(“String”) in Oracle OSB.

fn-bea:inlinedXML()

To convert XML into String you can use Xquery function fn-bea:serialize(XML) in Oracle OSB.

XMLToString

A working example you can find in my Github account in below url :

In this exmple we use globle weather check wsdl as input and call “GetWeather” operation. First we conver XML into string and then we convert string into XML format to call business service.

https://github.com/kamesh46/KameshOSBProject/tree/master/StringToXMLConversion

Happy learning!!!

Advertisements

2 thoughts on “Transformation of String to XML or XML to String Oracle OSB

  1. Hi while cosuming the xml from jms queue. I got the below body as request. The body is like CDATA .but I want the xml from that Cdata. Can you please help me regarding this issue.
    !<CDATA[?xml etc followed by elements. Now I need the elements present in that character data. Anu solution pls.

    Like

    • Anyhow your XQuery/XSLT will ignore CDATA tag. It will look for text only. If you use fn-bea:inlinedXML() function it will give you element in XML formant only. Can you post your XML and expected result in comments for more details?

      Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s