CData Sections in BizTalk Orchestration

Recently I worked for the first time with CData sections in XML messages. A CData section in an XML Document starts with <![CDATA[ and ends with ]]> and everything between is ignored by the XML parser.

In my scenario I got xml (with some CData sections) from a WebService, transformed it with a map (and did some other things in an orchestration) and sent it to another WebService. The first WS gave me xml with CData but the second WS received none.

After some debugging I found out that the xml arrived in the orchestration in the correct format (with CData sections). The place where the CData got lost was the map. The CData brackets where simply omitted during transformation. I found that there is a property called "CDATA Section Elements" at the map. (you get it in your property window if you click on the space in the middle in Biztalk mapper where you drop functoids) There I entered a xml node and after the transformation this node contained a CData Section. I was especially happy because this node was part of an any element in my xml message. Although the mapper does not know the schema of my whole message he inserted the CData section in the subnode.
The last question was how to specify more than one node to be CData nodes. I tried with comma and semicolon but only got errors when testing the map. After investigating the depths of BizTalk documentation I found the section where the "CDATA Section Elements" property is described and found the required information in the last sentence. :-)

"If you provide multiple values for this property, separate them with spaces."

Now I was able to finish the application correctly. The only interesting question left (but had no time to test it) is if there is a way to automatically recognize CData sections in an inbound document of a map and dynamically create the CData sections in the outbound document. (perhaps with a custom functoid) But that would be a seperate post in the future, since the current solution is sufficient for me.
 

posted @ Saturday, October 06, 2007 2:02 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345