Wednesday, 21 January 2015

Using ESB Add Namspace

When working with systems that utilize the older no-namespace style of XML documents, the ESB add namespace is handy for strong typing documents.

Why go to the effort of using it? You could create a schema and set the target namespace to blank and continue on your way. The problem lies when many documents utilize this same blank namespace and their root name is <Root> which is very common. I consider using a blank namespace as anti best practice, though each to their own.

The ESB Add Namespace component seems to not be useable without first adding a ESB Remove Namespace before it regardless of whether you're creating a receive or send pipeline. I think the problem is encoding related. Without adding ESB Remove Namespace you will get errors along the lines of 'Root element cannot be found'. Make sure to include these components before a disassembler so that the document can be resolved.

Example receive pipeline using ESB Add Namespace

No comments:

Post a Comment