Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Orchestrations - Creating Multipart Messages

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/7/2011 3:12:35 PM

1. Problem

You are building an integration solution and receive multiple documents that together form a single logical message in your back-end system. You must group these documents into one message by using a multipart message in BizTalk Server.

2. Solution

Multipart messages are created in BizTalk Server orchestrations, as opposed to being created as schemas. Multipart messages are a collection of message parts, with each part having a specific type. Message part types can be defined by an XSD schema or a .NET class. This solution describes how to use XSD schemas to define each of the message parts.

To create an orchestration and a multipart message, follow these steps:

  1. Open the project that contains the schemas. In this sample, we will use an order header schema and an order line item schema to demonstrate the use of multipart messages, as shown in Figure 1.

    Figure 1. The schemas being used
  2. Right-click the project, and select Add→New Item.

  3. In the Add New Item dialog box, select Orchestration Files from the Categories list and BizTalk Orchestration as the template, and give a descriptive name to your new orchestration. In our example, the orchestration is named MultiPartMessageOrchestration. Then, click Add.

  4. In the Orchestration View window, expand the Types node of the tree view so that the Multi-part Message Types folder is visible, as shown in Figure 2. (If the Orchestration View window is not visible, select View => Other Windows→Orchestration View.)

    Figure 2. Viewing multipart message types
  5. Right-click the Multi-part Message Types folder, and select New Multi-part Message Type, which creates a new multipart message type. A default message part is automatically added to all newly created multipart message types.

  6. Click the new multipart message type, and give it a descriptive name in the Properties window. In our example, the multipart message is named Order.

  7. Expand the new multipart message type, click the default message part, and give it a descriptive name in the Properties window. In our example, the message part is named Header. Note that the Message Body Part property is set to True.

  8. Click the Type property in the Properties window, and select the appropriate schema to associate with the message part, as shown in Figure 3. In our example, the schema is named OrderHeader.

    Figure 3. Setting the default message part's type
  9. Right-click the Order multipart message type, and select New Message Part, which creates a new message part.

  10. Click the new message part, and give it a descriptive name in the Properties window. In our example, the message part is named LineItems. Note that the Message Body Part property is set to False.

  11. Click the Type property in the Properties window, and select the appropriate schema to associate with the message part, as shown in Figure 4. In our example, the schema is named OrderLineItems.

    Figure 4. Setting an additional message part's type
  12. In the Orchestration View window, expand the top node of the tree view so that the Messages folder is visible.

  13. Right-click the Messages folder, and select New Message, which creates a message.

  14. Click the new message, and give it a descriptive name in the Properties window. In our example, the message is named MultiPartOrderMessage.

  15. Click the Message Type property in the Properties window, and select the appropriate type to associate with the message, as shown in Figure 5. In our example, we select the Order multipart message type.

Figure 5. Creating a multipart message

3. How It Works

Multipart messages allow for the grouping of multiple parts into a single message. In our solution, we group an order header document and an order line item document into a single order message.

All messages within BizTalk Server are multipart messages, although most of them just have a single part (the message body) and, therefore, are not created as a multipart message within orchestrations. Messages with a single part are treated slightly differently by BizTalk Server, as the single part is not displayed when referring to the message and the message is referred to directly.

The concept of messages having multiple parts is easier to grasp after creating a multipart message type within an orchestration, where you must explicitly create the different parts of a message. Each message part has a number of properties associated with it, as listed in Table 1.

Table 1. Message Part Properties
PropertyPart
DescriptionSummary of message part
IdentifierName of the message part
Message Body PartFlag indicating whether the message part contains the message body (every multipart message must have one and only one body part)
Report To AnalystFlag indicating whether the message part should be exposed via the Visual Business Analyst Tool
TypeThe type defining the message part's content

The type of message part can be either a .NET class or an XSD schema. If a .NET class is specified, the class must be XML-serializable or support custom serialization. If an XSD schema is used, the schema must be included in the same BizTalk Server project as the multipart message type or in a referenced assembly. By specifying the XmlDocument type, a message part can contain any valid XML document. The multipart message type has the properties listed in Table 2 associated with it.

Table 2. Multipart Message Type Properties
PropertyPart
IdentifierName of the multipart message type
Report To AnalystFlag indicating whether the multipart message type should be exposed via the Visual Business Analyst Tool
Type ModifierThe scope of the multipart message type; choices are Private (accessible within the orchestration), Public (accessible everywhere), or Internal (accessible within the same project)

Once you have defined your multipart message types, you can create and access message instances of those types within the orchestration. Figure 6 illustrates how you can assign the Header and LineItems message parts of the Order message. In this example, the OrderHeaderMessage and OrderLineItemsMessage messages are instances of the Header and LineItems schemas.

Figure 6. Assigning message parts

Some common uses of multipart messages in BizTalk Server are when you are consuming a service or processing e-mail messages within orchestrations. When you add a web service reference to an orchestration, a multipart message type is generated automatically, with one part created for each message part defined in the web service's WSDL file. For those scenarios where e-mail messages are being processed, it is common to use multipart message types to handle MIME multipart messages; the body message part would contain the body of the e-mail, and subsequent parts could contain e-mail document attachments.
Other -----------------
- Windows Server 2008 R2 : File Server Resource Manager (part 4)
- Windows Server 2008 R2 : File Server Resource Manager (part 3)
- Windows Server 2008 R2 : File Server Resource Manager (part 2)
- Windows Server 2008 R2 : File Server Resource Manager (part 1) - Installing the File Server Resource Manager Tools & FSRM Global Options
- Windows Server 2008 R2 : Volume-Based NTFS Quota Management
- Exchange Server 2010 : Installing Edge Transport Monitoring Certificates (part 3) - Install the Agent on the Edge Transport & Configure the Agent to Use the Certificate
- Exchange Server 2010 : Installing Edge Transport Monitoring Certificates (part 2) - Request a Certificate from the Root CA Server
- Exchange Server 2010 : Installing Edge Transport Monitoring Certificates (part 1) - Create Certificate Template & Request the Root CA Server Certificate
- SharePoint 2010 : Designing and Managing Pages and Sites for Knowledge Workers - An Overview of Site Collection Administration Tools
- SharePoint 2010 : Designing and Managing Pages and Sites for Knowledge Workers - Reviewing the Site Actions Tools
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server