Archive for November, 2010

Formatting an XML String for a BizTalk Map

I was calling a WCF service from an orchestration that returned an xml response as a string wrapped in a SOAP header envelope.

I removed the SOAP header envelope with simple string manipulation and was left with an Xml response that I could then load into an XmlDocument type.

The Xml message was then used as the source to a custom XSLT map which did not work properly even though in unit testing the map worked fine.

I removed carriage returns and line feeds from the original string but that did not help either.

Only after indenting the xml string (using System.Xml.Formatting.Indented) and then loading the string into an XmlDocument did the map finally work.

Hope this helps someone else with a similar issue.