Recently I was testing a BizTalk map inside Visual Studios. The input schema was auto generated using the SQL Adapter and the output was a simple text file. I was using a sample file provided to me from a past generation from the schema (or so I thought) to test the map.

When I was testing, I keep getting a blank file as output and a strange error. The error was: Native serialization error: Root element is missing.

I had both input and output validation turned on and the input sample file was passing validation. To confirm this, I took the schema and sample file and confirmed it validated using Visual Studios.

Since I was not having much luck testing inside Visual Studios, I decided to set up a send & receive port and test the map through BizTalk to see if I could get different result. This time, I got a subscription not found error.

Odd, since the schema and maps are all deployed. I check the message that was suspended and noticed it was not mapped; my original message was published and suspended.

This could only mean the message type was wrong – somehow. So I took a closer look at the namespace in the sample message. It was slightly off! I corrected the namespace in the sample file and everything worked fine.

Overall, the moral of the story is three fold:

1. Schema Validation inside BizTalk DOES NOT validate namespace; at least it doesn’t if there is only one.

2. When you get a strange mapping error with no output, check your namespace!

3. Use extreme caution when typing in the namespace fields when using the SQL Adapter. Evidently in a past test the namespace was typed incorrectly. When the SQL Schema was auto generated, this wrong schema was use to make the sample file I was using.

This took me over an hour to figure out so I guess I’m getting rusty at testing BizTalk maps. Hope this helps someone else out down the road.