An interchange is a group of messages that are contained within one larger message. In this post, I describe how to split an XML interchange into individual messages to be processed and saved to the MessageBox on BizTalk Server.
The interchange and the messages
The interchange in this case is shown below.
<Envelope Type="Updates" xmlns="http://Stm.Messaging.Schemas.Updates">
<CompanyUpdate CompanyID="1" Name="Company A" Address="Street 1" />
<CompanyUpdate CompanyID="2" Name="Company B" Address="Street 2" />
<CompanyUpdate CompanyID="3" Name="Company C" Address="Street 3" />
The interchange will be split into single
Create an envelope Schema
The first thing to do is to create an envelope schema. This can easily be done by using the Add Generated Schemas in Visual Studio and generate a schema from the interchange. In the schema node, set the
property to Yes. In the root node (In this case
property to the parent node of the body messages. (In this case, the
node) In the body messages node (
Data Structure Type
. In this example, I have also set the
to the Schema.
Create a Schema for the individual messages
Schema (Add Generated Items) from an individual message.
Deploy and test
Deploy the two schemas and use the
pipeline in a receive location. This will split the interchange into individual
Target Namespace = "http://Stm.Messaging.Schemas.Updates"
Root Node = "CompanyUpdate"