Tuesday 30 October 2007

BizTalk ESB AddNamespace Pipeline Component Bug

If you've not come across the ESB AddNamespace Pipeline Component it's really great for injecting a namespace into xml documents you have no control over.

We're using this component on a project at the moment to aid routing messages through the BizTalk Message Box. Having created a generic "AddNamespace Receive Pipeline" we're configuring the properties on the pipeline through the BizTalk Administration Tool for each of the receive locations.

Since we only want to add a default namespace, a'la xmlns="http://venturetechnologies.co.uk/schemas/ourdoc" there's no need to set the NamespacePrefix property, however if you leave it untouched (empty) you'll get an Null exception at run-time. To work around this simply enter a value in the property field, tab out back in and delete the value, "OK" the property editor and voila, no more errors.

If we get time we'll find a fix and post it up to the CodePlex site, but for now the workaround is quick and easy and doesn't pollute the ESB code base.