Xml declaration gotcha
I've been running a simple biztalk test orchestration that, as with most test processes, starts through a message arriving at a folder.
My message was generated by an application written by another department.
As soon as a message is dropped in the file drop it's being picked up by Biztalk as expected, which reacts with an immediate failure in the receive pipeline (I've used standard XmlReceive) and with an error message in the event log -
There was a failure executing the receive pipeline:
Microsoft.BizTalk.DefaultPipelines, Version=188.8.131.52, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port:
"***********" URI: "**********" Reason: Length cannot be less than
Parameter name: length
It took me a while to figure this out, but the bottom line is -
The problem was in the document's xml declaration. the application used single quotes around the attributes -
<?xml version='1.0' encoding='utf-8' ?>
- which is perfectly legal as far as I understand according to the w3c definition here .
Apparently BizTalk does not like that.
Changing the xml declaration to use double quotes -
<?xml version="1.0" encoding="utf-8" ?>
- solved the problem, which was easy enough to fix but I wish we didn't need to...
If this is a valid xml declaration I wish BizTalk would support that, if it's not - I'd love to hear from someone.