Need Help with Multiple Message Types through Single Pipeline

I am attempting to use a common xml disassembler. I have created distinct schemas for my envelopes and body parts.

For example:

Envelope A1
http://namespace1/#A1Elements

Body Part A1
http://namespace1/#A1Element

Envelope B1
http://differentnamespace/#B1Elements

Body Part B1
http://differentnamespace/#B1Element

Sample messages would look like:

<A1Elements xmlns="http://namespace1/">
<A1Element>someContent</A1Element>
<A1Element>otherContent</A1Element>
</A1Elements>

<B1Elements xmlns="http://differentnamespace/">
<B1Element>someContent</B1Element>
<B1Element>otherContent</B1Element>
</B1Elements>

I tried to construct a single pipeline to handle both A1 and B1 Envelopes. I added 1 - Xml Disassembler with both Envelope Schemas and I also tried adding 2 - Xml Disassemblers each with a distinct envelope schema. It seems that in either case whichever schema I add first is found and processed ok. Which ever comes second, I receive this error:

There was a failure executing the receive pipeline: "Lab_Sample.TestPipeline, Lab Sample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cb0ab58ff5124414" Source: "XML disassembler" Receive Port: "SampleIn" URI: "E:\Biztalk Test Data\SampleIn\B1\Copy*.xml" Reason: Document type "http://differentnamespace/#B1Elements" does not match any of the given schemas.

I currently have 1 Receive Port and 2 receive locations (a seperate file location for each of the above messages, but I would eventually like to combine to 1) each receive location uses the TestPipeline.

Thanks in advance for the help,
Erds

[1813 byte] By [Erds] at [2008-1-7]
# 1
Hi,
Try the message with prefix, like:
<ns0:A1Elements xmlns:ns0="http://namespace1/">
<ns0:A1Element>someContent</ns0:A1Element>
<ns0:A1Element>otherContent</ns0:A1Element>
</ns0:A1Elements>
(I'm sure you have deployed an assembly with schemas and restarted BizTalk host instance.)
Regards,
Leonid Ganeline
http://geekswithblogs.net/leonidganeline/
LeonidGaneline-MVP at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 2

Thanks for the reply, however it still is not working. A1Elements processes just fine, but B1Elements generates:

There was a failure executing the receive pipeline: "msdnSample.TestPipeline, msdnSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cb0ab58ff5124414" Source: "XML disassembler" Receive Port: "ReceivePort" URI: "E:\Biztalk Test Data\msdnIn\Copy*.xml" Reason: Document type "http://differentnamespace/#B1Elements" does not match any of the given schemas.

I will enclose my schemas:

<?xml version="1.0" encoding="utf-16"?>
<xsTongue Tiedchema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://namespace1/" targetNamespace="http://namespace1/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<bTongue TiedchemaInfo is_envelope="yes" />
</xs:appinfo>
</xs:annotation>
<xs:element name="A1Elements">
<xs:annotation>
<xs:appinfo>
<b:recordInfo body_xpath="/*[local-name()='A1Elements' and namespace-uri()='http://namespace1/']" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xsTongue Tiedequence>
<xs:any />
</xsTongue Tiedequence>
</xs:complexType>
</xs:element>
</xsTongue Tiedchema>

<?xml version="1.0" encoding="utf-16"?>
<xsTongue Tiedchema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://namespace1/" targetNamespace="http://namespace1/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="A1Element">
<xs:complexType />
</xs:element>
</xsTongue Tiedchema>

<?xml version="1.0" encoding="utf-16"?>
<xsTongue Tiedchema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://differentnamespace/" targetNamespace="http://differentnamespace/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<bTongue TiedchemaInfo is_envelope="yes" />
</xs:appinfo>
</xs:annotation>
<xs:element name="B1Elements">
<xs:annotation>
<xs:appinfo>
<b:recordInfo body_xpath="/*[local-name()='B1Elements' and namespace-uri()='http://differentnamespace/']" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xsTongue Tiedequence>
<xs:any />
</xsTongue Tiedequence>
</xs:complexType>
</xs:element>
</xsTongue Tiedchema>

<?xml version="1.0" encoding="utf-16"?>
<xsTongue Tiedchema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://differentnamespace/" targetNamespace="http://differentnamespace/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="B1Element">
<xs:complexType />
</xs:element>
</xsTongue Tiedchema>

And the Xml for my pipeline:

<?xml version="1.0" encoding="utf-16"?>

<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" PolicyFilePath="BTSReceivePolicy.xml" MajorVersion="1" MinorVersion="0">

<Description/>

<Stages>

<Stage CategoryId="9d0e4103-4cce-4536-83fa-4a5040674ad6">

<Components/>

</Stage>

<Stage CategoryId="9d0e4105-4cce-4536-83fa-4a5040674ad6">

<Components>

<Component>

<Name>Microsoft.BizTalk.Component.XmlDasmComp</Name>

<ComponentName>XML disassembler</ComponentName>

<Description>Streaming XML disassembler</Description>

<Version>1.0</Version>

<Properties>

<Property Name="EnvelopeSpecNames">

<Value xsi:type="xsdTongue Tiedtring">msdnSample.A1Elements</Value>

</Property>

<Property Name="EnvelopeSpecTargetNamespaces">

<Value xsi:type="xsdTongue Tiedtring">http://namespace1/</Value>

</Property>

<Property Name="DocumentSpecNames">

<Value xsi:type="xsdTongue Tiedtring"/>

</Property>

<Property Name="DocumentSpecTargetNamespaces">

<Value xsi:type="xsdTongue Tiedtring"/>

</Property>

<Property Name="AllowUnrecognizedMessage">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="ValidateDocument">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="RecoverableInterchangeProcessing">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="HiddenProperties">

<Value xsi:type="xsdTongue Tiedtring">EnvelopeSpecTargetNamespaces,DocumentSpecTargetNamespaces</Value>

</Property>

</Properties>

<CachedDisplayName>XML disassembler</CachedDisplayName>

<CachedIsManaged>true</CachedIsManaged>

</Component>

<Component>

<Name>Microsoft.BizTalk.Component.XmlDasmComp</Name>

<ComponentName>XML disassembler</ComponentName>

<Description>Streaming XML disassembler</Description>

<Version>1.0</Version>

<Properties>

<Property Name="EnvelopeSpecNames">

<Value xsi:type="xsdTongue Tiedtring">msdnSample.B1Elements</Value>

</Property>

<Property Name="EnvelopeSpecTargetNamespaces">

<Value xsi:type="xsdTongue Tiedtring">http://differentnamespace/</Value>

</Property>

<Property Name="DocumentSpecNames">

<Value xsi:type="xsdTongue Tiedtring"/>

</Property>

<Property Name="DocumentSpecTargetNamespaces">

<Value xsi:type="xsdTongue Tiedtring"/>

</Property>

<Property Name="AllowUnrecognizedMessage">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="ValidateDocument">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="RecoverableInterchangeProcessing">

<Value xsi:type="xsd:boolean">false</Value>

</Property>

<Property Name="HiddenProperties">

<Value xsi:type="xsdTongue Tiedtring">EnvelopeSpecTargetNamespaces,DocumentSpecTargetNamespaces</Value>

</Property>

</Properties>

<CachedDisplayName>XML disassembler</CachedDisplayName>

<CachedIsManaged>true</CachedIsManaged>

</Component>

</Components>

</Stage>

<Stage CategoryId="9d0e410d-4cce-4536-83fa-4a5040674ad6">

<Components/>

</Stage>

<Stage CategoryId="9d0e410e-4cce-4536-83fa-4a5040674ad6">

<Components/>

</Stage>

</Stages>

</Document>

Erds at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 3

I am surprised no one has responded. Is this a really difficult question?

Erds at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 4
I don't really understand your schema structure. Are you sure the messages you posted validate against your schemas? I'd try and set up a structure that more like the one below (this is an example of how I'd set up A1Elements):

Code Snippet

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:ns0="http://ACME.Schema.A1Element/1.0" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://ACME.Schema.A1Elements/1.0" targetNamespace="http://ACME.Schema.A1Elements/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation=".\a1element.xsd" namespace="http://ACME.Schema.A1Element/1.0" />
<xs:annotation>
<xs:appinfo>
<b:schemaInfo is_envelope="yes" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:references>
<b:reference targetNamespace="http://ACME.Schema.A1Element/1.0" />
</b:references>
</xs:appinfo>
</xs:annotation>
<xs:element name="A1Elements">
<xs:annotation>
<xs:appinfo>
<b:recordInfo body_xpath="/*[local-name()='A1Elements' and namespace-uri()='http://ACME.Schema.A1Elements/1.0']" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="ns0:A1Element" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


What I've done here is changing the namespaces to different namespaces in the schemas (otherwise you'll have to include the referenced schemas and I don't think this is the right way here). I've set the namespaces to http://ACME.Schema.A1Element/1.0, http://ACME.Schema.A1Elements/1.0 and so on. Then I've imported the A1Element schema in to the A1Elements schema and set the maxOccurs to unbounded. This lets me have a typed node to A1Element and not a any-typed node. My guess is that this what you're after but I might be wrong?

I've uploaded the complete schema project here so you can downloaded and have a look at it. I'll keep it there for a couple of days.

RichardHallgren at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 5
Please, double check this:
"... It seems that in either case whichever schema I add first is found and processed ok. Which ever comes second, I receive this error:..."
Did you feed one message then other?.. Did you get the errors on the A1.. schema and on the B1? Give more information, please.
Regards,
Leonid Ganeline
LeonidGaneline-MVP at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...