Our current infrastructure supports over 200 interfaces with external trading partners in the B2B role. Unfortunately, some of the cXML partners cannot handle Xml Namespaces and insist on receiving DOCTYPES.
Although DOCTYPE’s can be added through the BizTalk mapper, we needed a mechanism to remove the Xml Namespace from the resultant message before passing through to a client. As a result, I created the Add Doctype Declaration encoding component (send pipeline) to add DOCTYPE’s and remove Xml namespaces.
The component uses an Xml Document object to parse the message and add the DOCTYPE declarations. In addition, the Xml Namespace can be removed if required using the [boolean] ‘RemoveNamespace’ property (if this is set to false, the namespace will remain in the final message.
This really is the first release of the component (think of it as beta) and although it is ready for production, there are a number of enhancements I want to make, including:
- Produce a version in .Net 2.0 for BizTalk 2006 (our production environment is currently 2004, hence the current code is targeted to .Net 1.1);
- For BizTalk 2006, have the component configurable at run-time rather than design-time;
- Identify the root element programmatically, rather than through a component property;
- Remove DOCTYPE addition from the component and use the mapper to add the declaration;
- Create a receive pipeline component to add an Xml Namespace based on a DOCTYPE declaration;
I hope this component will be of use, either in your projects or as a starter for enhancements. I will continue to update the code and release enhancements through this blog.