I could make up a statistic that says “83% of all BizTalk schemas use the namespace automatically assigned to it” and probably not be wildly off. That said, I wondered if BizTalk handled all the different namespace styles in the same way. Specifically, does BizTalk care if we use schemas with traditional “URL-style” namespaces, URN namespaces, single value namespaces, and empty namespaces? Short answer: it doesn’t matter.
I suspect that many XSD designers currently go with a URL-based approach like so:
However, you could also prefer to go with a Uniform Resource Name style like this:
You might also choose to do something easier for you to understand, which might be a single identifier. For instance, you could just use a namespace called “Enterprise” for company wide schemas, or “Vendor” for all external partner formats.
Finally, you may say “forget it” and not use a namespace at all.
The first thing I tested was simple routing. The subscription for a URN-style message looked like this:
The “single value” format subscription looks like this:
Finally, if you have no namespace at all on your schema, the message subscription could look like this:
In that case, all you have is the root node name. After testing each routing scenario, as you might expect, they all work perfectly fine. I threw a property schema onto each schema, and there were no problems routing there either.
I also tested each schema with the Business Rules Engine and each worked fine as well.
Moral of the story? Use a namespace style that works best for your organization, and, put some real thought into it. For instance, if a system that you have to integrate with can’t do namespaces, don’t worry about changing the problem system since BizTalk can work just fine.
I didn’t go through all the possible orchestration, mapping and WCF serialization scenarios, but would expect that we’d see similar behavior. Any other real-life tales of namespaces you wish to share?