February 17, 2010 at 11:22 AM
For one of our projects, we are receiving unicode messages through a receive pipeline containing only a BTF disassembler (BizTalk Framework). The disassembler has the standard properties and the AllowUnrecognizedMessage set to true.
When we are receiving a UTF16 unicode message (with no byte order mark in the stream!), the disassembler crashes with the known error : No disassemble stage components can recognize the data.
Sending a UTF8 message works.
The BizTalk Xml Disassembler normally tries to detect the message's encoding by executing these steps:
- If a byte order mark is available in the data, the encoding is extracted from it.
- If the IBaseMessagePart.Charset property is set, that setting will be used.
- Xml Declaration will be used, when available
- If none of the above are met, the default, UTF-8, is used.
The message we received had none of the first 3 conditions, so it was interpreted as UTF8. By setting the Charset property on the IBaseMessage in our custom pipeline component, we were able to pass it through the Xml Disassember.
The BtfDisassembler was raising another error, now. My conclusion (and Tomas Restrepo's too) was that the BtfDisassembler was not able to process Unicode messages.
The solution to this was using our CODit Charset decoder that creates a new stream, with the UTF8 encoding. This was working.
Thanks to Tomas Restrepo, who investigated a lot on this and wrote an entry on his blog : http://www.winterdom.com/weblog/2006/05/19/DecodingUTF16MessagesWithTheBizTalkFrameworkDisassembler.aspx
3b7a3b52-22bb-4823-bf12-189ec496ce4d|0|.0