BizTalk Mapper Multiple Schemas

12 02 2008

Today I was preparing to do some maintenance work, and while studying the relevant maps and schemas discovered a very unusual looking map—unusual to me anyway. I have included the XML source definition of the map below for reference. The source definition of the map was an aggregation of two schemas. That is, the source definition had two root elements InputMessagePart_0 and InputMessagePart_1 which contained XSD imports of two schemas. The thing that took me by surprise was that the source definition of this particular map was not actually explicitly defined through a “wrapping” schema definition. Instead the actual details of the aggregation was defined and stored in the map definition itself, under the target namespace of:
http://schemas.microsoft.com/BizTalk/2003/aggschema

The only way I could work out how to get the BizTalk development tools to create an aggregated map source/destination definition, was through the orchestration designer in VS.NET. Drop in a transform shape. When configuring the transform shape ensure that the “Create New Map” option is selected, and set its source (and/or destination) to multiple (more than one) messages, click OK. BizTalk will generate the new aggregated map definition. Sweet!

<SrcTree>
<xs:schema
   xmlns:tns=”http://schemas.microsoft.com/BizTalk/2003/aggschema&#8221;
   xmlns:ns2=”http://Net.Bencode.Schema1&#8243;
   xmlns:ns1=”http://Net.Bencode.Schema2&#8243;
   xmlns:b=”http://schemas.microsoft.com/BizTalk/2003&#8243;
   targetNamespace=”http://schemas.microsoft.com/BizTalk/2003/aggschema&#8221;
   xmlns:xs=”http://www.w3.org/2001/XMLSchema”&gt;
  <xs:import schemaLocation=”.\schema1.xsd” namespace=”http://Net.Bencode.Schema1&#8243; />
  <xs:import schemaLocation=”.\schema2.xsd” namespace=”http://Net.Bencode.Schema2&#8243; />
  <xs:element name=”Root”>
   <xs:complexType>
    <xs:sequence>
     <xs:element name=”InputMessagePart_0″>
      <xs:complexType>
       <xs:sequence>
        <xs:element ref=”ns1:MyRoot” />
       </xs:sequence>
      </xs:complexType>
     </xs:element>
     <xs:element name=”InputMessagePart_1″>
      <xs:complexType>
       <xs:sequence>
        <xs:element ref=”ns2:MyRoot” />
       </xs:sequence>
      </xs:complexType>
     </xs:element>
    </xs:sequence>
   </xs:complexType>
  </xs:element>
</xs:schema>
</SrcTree>

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: