About Me

If life is all about change, motion and flow, I would be the one cruising past you on a SunDancer.

Friday, September 26, 2008

Using Envelope Schema in Biztalk

What is Envelope Schema: An envelope schema is a special type of XML schema. Envelope schemas are used to define the structure of XML envelopes, which are used to wrap one or more XML business documents into a single XML instance message. When you define an XML schema to be an envelope schema, a couple of additional property settings are required, depending on such factors as whether there are more than one root record defined in the envelope schema

As most of you aware of the fact that you can either
  • Split a single message into multiple messages using Receive pipeline.
  • Append multiple mesages into a single message using a Send Pipeline

In both the cases you would need to use an "Envelope Schema" to group them together. Following are instructions how to configure the Envelope schema to achieve the above processes.

Splitting a single message into multiple messages:
You need to create an Orders envelope schema, and Order document schema for that.

Steps:

  1. Create a new BizTalk project
  2. Add the Order document schema with OrderId and Date elements
  3. Add the Orders envelope schema with only root element Orders
  4. Click on the Schema node and set its "Envelope" property to true
  5. Click on the Orders node, and click on the body xPath property, choose Orders and click ok.
  6. Deploy the project
  7. Create a receive location and choose XmlReceive pipeline
  8. Open the pipeline properties dialog, and set envelope schema to the Orders schema, and document schema to Order schema

Append multiple messages into a single message: You need to create an Orders envelope schema, and Order document schema for that.

Steps:

  1. Create a new BizTalk project
  2. Add the Order document schema with OrderId and Date elements
  3. Add the Orders envelope schema with only root element Orders
  4. Click on the Schema node and set its "Envelope" property to true
  5. Click on the Orders node, and click on the body xPath property, choose Orders and click ok.
  6. If you are invoking a send pipeline component within an Orch expression: Open the pipeline properties dialog, and set envelope schema to the Orders schema, and document schema to Order schema
  7. Deploy the project

No comments: