BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Developing and Testing Maps which have Multiple Source and Destination Schemas

HI Guys,

Let’s see all the stuff required for Developing and Testing Maps which are having more than a Single Schema in either Source or Destination or Both.

So we are going to see all the below scenarios.

  1. Single Source – Single Destination
  2. Multiple Source – Single Destination
  3. Single Source – Multiple Destination
  4. Multiple Source – Multiple Destination

Development

Developing a Map using a Single Source and Single Destination schema should be a straight forward thing which you all should know. So I am not going to discuss on the first point.

Now, if we want to add one more Source or Destination schema to an existing Map, you will be upset to know the fact that none of the existing versions of Biztalk support this featureL. And you will be surprised to know that this can be achieved using an Orchestration !!.

Yes, it’s true.

Steps for creating a Map with Multiple Source/ Destination schemas:

  1. Create a dummy orchestration. ( This is not required once we are done with map creation)
  2. Insert a Transform shape.
  3. Create 4 messages (2 for source and 2 for destination) and assign the message type property to the required schema.
  4. Assign the 2 source schema messages to the list of Input messages for the shape.
  5. Similarly assign the 2 destination schema messages to the list of Output messages for the shape.(You can either double click the Transform shape to assign these or you can assign using the properties window )
  6. Now when you click OK , the map will be launched. (If you select the Check box available at the bottom)
  7. It will look like below.

Hurrah! You are done with creating a map with Multiple Source and Multiple Destination schemas.

If you observe the newly created map, the schemas are not placed directly under the Root level. They are placed as Message parts. Yes, we achieve this Multiple Schemas concept using Message Parts.

Now you can go ahead and do the required mapping as how you will be doing in the case of Single Source – Single Destination Maps.

Testing

Testing is not as easy as development in this case. Its little tricky.

  1. Single Source – Single Destination: You should know this. We use Map Properties window for the unit testing of the map.
  2. Multiple Source – Single Destination: To test this you need a message which will have both the input schemas. But the fact is as we don’t have the details in a Single message, we have gone for Multiple Source. So now our aim is to construct a Single Message which will include both schemas. We can create the input message manually. But that will give scope for many manual errors and the message may not get validated by the map because of namespace issues. So it’s always better to get the input message constructed by Biztalk itself.

Let’s see how we going to construct.

We have to create a map which is inverse of the above map. So it will have Single Source and Multiple Destination schemas. Now keep the TestMapInput property of the map to “GenerateInstance” and test the map. The output of the map is nothing but the required input xml format for the Multiple Source – Single Destination map! Isn’t it cool?

Your sample should look like this if you have 2 schemas in the dummy destination map.

(Few changes need to be done to this xml which are explained below)

  1. Single Source – Multiple Destination : Shouldn’t be having any questions on this .
  2. Multiple Source – Multiple Destination: Hope you should be having answer for this by this time. Just create dummy maps which will have the multiple source and multiple destination schemas as part of their destination schemas and generate the output instance for these dummy maps. You are done there…

Converting the generated output xml to the required input xml format:

Modify the generated output file as below.

<ns0:Root xmlns:ns0=”http://schemas.microsoft.com/BizTalk/2003/aggschema&#8221;

          xmlns:ns1=”http://MultipleSourceAndDestinationSchemas.Schema1&#8243;

          xmlns:ns2=”http://MultipleSourceAndDestinationSchemas.Schema2″&gt;

  <InputMessagePart_0>

    <ns1:Schema1>

      <Record1></Record1>

    </ns1:Schema1>

  </InputMessagePart_0>

  <InputMessagePart_1>

    <ns2:Schema2>

      <Record2></Record2>

    </ns2:Schema2>

  </InputMessagePart_1>

</ns0:Root>

You have to replace the “OutputMessagePart” with “Input MessagePart”(See the highlighted ones in the above sample). Now this is your correct input xml which you can use to test the original map.

If you observe Biztalk places different namespaces for each of the schema utilized in the map. When we try to construct this input manually we may end up in creating errors because of this. So it’s advisable to create the input through biztalk.

July 8, 2011 - Posted by | Maps | , , ,

1 Comment »

  1. This tip is in my TOP 10!! Thanks a lot. Creating the input file can be a real pain.

    Comment by Jordan | April 12, 2013 | Reply


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: