Search code examples
xmlvisual-studio-2013biztalkbiztalk-2013r2

BizTalk error: failure executing receive pipeline, document type does not match any of the given schemas


I got stuck on this error, and would appreciate any good idea to get closer to a solution. The schemas used are a global standard and not under my control.

Error message in full:

There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "[receive port name]" URI: "[url to imput xml]" Reason: Document type "[namespace]#[envelope root element name]" does not match any of the given schemas."

My setup: I have envelope schema for XMLReceive pipeline to debatch messages. I have specified assembly information in receive location's EnvelopeSpecNames to achieve that. I have set schema property Envelope = Yes, and specified Root Reference (since there are many root elements in schema). I use PropertySchema to promote some properties from envelope to be used for later processing and all references seems to be correct.

I have double checked configuration, and schema referenced in error message is known by BizTalk (also checked db to verify, existing and no duplicates). Verified every single name, by re-copy-and-paste in every place. I have checked to import application into an entirely new environment, with the same error.

What have I missed?

My previous theory was that error gives wrong information but was caused by the references to/from the property schema, but everything checks out. My current theory is that error is about something completely else - but what!?


Solution

  • In just about 10 seconds after actually posting this question, the theory materialized into an explicit suggenstion of a solution: body xpath.

    So, in summary you need to specify: - Envelope = Yes (to tell BizTalk to treat message as an enveloped message) - Root element (to give correct root element for envelope) - body xpath (i.e. xpath expression to the content message within the envelope)

    Hope this helps anyone!