Using DocumentSpecName of the pipeline configuration
A schema can be defined in the ‘DocumentSpecName’ attribute of the pipeline configuration properties (in the dissamble stage).
When no schema is defined and there are multiple schema’s with the same combination for ‘Target Namespace’ (optional) and ‘Root Name’, you ‘ll get following error in the receive pipeline:
There was a failure executing the receive pipeline: “<ReceivePipeline>” Source: “XML disassembler” Receive Port: “<ReceivePortName>” URI: “<URI>*.xml” Reason: Cannot locate document specification because multiple schemas matched the message type “<TargetNameSpace><RootName>”.
The use of “DocumentSpecName” attribute in the configuration section of the pipelines is there to direct the pipeline to validate the message against a specific schema in the given assembly. The attibute should be filled with the schema full name (‘<schema type>, <schema assembly>’) as shown in below figure. This should solve the above error.
The issue becomes more complex when using multi-part schemas. In htis situation you’ll get following error:
There was a failure executing the receive pipeline: “<ReceivePipeline>” Source: “XML disassembler” Receive Port: “<ReceivePort>” URI: “<URI>*.xml” Reason: No Disassemble stage components can recognize the data .
What BizTalk want to tell us is that at this stage, given the specific configuration of DocumentSpecName Attribute, in the well known syntax of “<schema type> ,<schema assembly full name>” is not enough for multipart schemas.
Turns out that there should be an additional value is needed in the DocumentSpecName-attribute to fully define the schema. So the above value syntax is not enough, it will direct the pipeline to the desired schema in the assembly, but it doesn’t say which root it should validate against.
The correct syntax in this case is : “<schema type>+<root name> ,<schema assembly full name>”
So by adding the root name after the ‘+’ -sign solves the issue for multipart-schemas (schemas with multiple root nodes).