Enroll Now!!! and get 10% special Discount on all courses. Limited Time only!!!

How to Pass XML Message Embedded In another XML

Last updated on Tue 17 Mar 2020



While developing Web Services it is necessary to send an XML message embedded in a SOAP envelope. XML messaging specification is based on the basic principle of providing a simple way to transport multiple XML documents within one logical XML construct without dictating any layered semantics of a messaging protocol that might be layered on top. The general philosophy is to provide the general structure upon which messaging protocols for specific business or technological purposes can be layered allowing the identification of that messaging intent but not dictating the exact syntax and semantics of the subject message. In this way, manifests, metadata, and other messaging specific constructs can be tailored to specific vertical markets or technology applications.

For example:

If you are sending an XML message as one of the Property Sets for a workflow which will be later interpreted using Integration object. And you inserted an xml message inside an SOAP element hoping that Siebel would consider that as string of characters. But it considered that as having a special meaning. The partial SOAP envelope is below.










Where the element IncomingXML contains one of the input propertysets in the workflow. When Siebel receives this message it would parse the entire XML and not ignore the special characters.

To avoid having parser to understand that there is an embedded xml message inside the xml element we enclose the message inside a CDATA (Character Data) block like in the below case. When the parser sees the CDATA, it understands that as an actual message and not to parse it.




This way the actual message won’t be altered. Notice that the CDATA section starts with “

Using CDATA we can also send functions, javascript, URLs etc. I believe that CDATA is used very often.

Also keep in mind that the message enclosed inside CDATA cannot contain “]]>” and nested CDATA is not allowed.

Let us know what you think. Post your comments.

Drop us a Query

+91 97846 54326

Available 24x7 for your queries