Capture the result in CDATA format in OSB

My requirement is to capture the error data in CDATA format.

In my case when ever there is some error occurs i have to send the complete details of  that error in Description field.

<ns9:Message>
<ns9:Status>E</ns9:Code>
<ns9:Code>BEA-300001</ns9:Code>
<ns9:Description>MyDescription</ns9:Description>
</ns9:Message>

In general we will send the $fault as the error to consumer, To do this we need to use serialize function , this function will convert the xml data in to string format.

fn-bea:serialize($fault/ctx:details)
EX:-  <ns9:Description>{fn-bea:serialize($fault/ctx:details)}</ns9:Description>
Result :- 
<ns9:Description><![CDATA[<ctx:details xmlns:ctx=”http://www.bea.com/wli/sb/context”><ns0:ValidationFailureDetail xmlns:ns0=”http://www.bea.com/wli/sb/stages/transform/config”><ns0:message>Expected element ‘EmpNumber@http://www.rubix.nl/someNamespace’ </ns0:ValidationFailureDetail></ctx:details>]]></ns9:Description>
Advertisements

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