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 - Receiving Untyped Messages

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/11/2011 6:48:32 PM

1. Problem

You have messages that conform to several different schema types. You wish to create a single orchestration to consume the messages and process them in a generic fashion.

2. Solution

BizTalk orchestrations deal with messages that are strongly typed. A strongly typed message conforms to a selected BizTalk schema or .NET class, and the message inherits its properties from this schema or class. An untyped message is configured to use System.Xml.XmlDocument as the message type and is not tied to a specific schema.

For example, a large business may receive purchase orders from several different systems, and each message must follow the same processing steps. Although the messages are similar, they differ in minor details and are strongly typed to different schemas. In order to process the messages from these disparate systems using the same process, you may wish to define a process with an untyped message to receive the different purchase order schemas into the same receive port.

NOTE

It is important that you have a basic understanding of receiving messages prior to implementing untyped messages.

To create an untyped message and use it within an orchestration, take the following steps:

  1. In the Orchestration View window, expand the top node of the tree view (this node will have the same type name as the orchestration) so that the Messages folder is visible.

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

  3. Click the new message, and give it a descriptive name in the Properties window. In this example, the message is named incomingOrder.

  4. Click the Message Type property in the Properties window, and select the .NET type System.Xml.XmlDocument.

  5. From the toolbox, drag a Receive shape onto the orchestration directly beneath the green circle at the top of the design surface.

  6. With the Receive shape selected, specify the shape's Name, Message, and Activate properties. In our example, we use ReceiveOrder, incomingOrder (created in step 3), and True, respectively.

    NOTE

    All message types will be received by an untyped port. Therefore, if you directly bind your port to the MessageBox, you will receive every message received into the MessageBox. This could create unintended behavior down the road.

  7. Right-click one of the Port Surface areas, and select New Configured Port. This will open the Port Configuration Wizard.

  8. Step through the Port Configuration Wizard, specifying the following items (accept all other default values):

    • Port name: ReceiveOrderPort

    • New port type name: ReceiveOrderPortType

    • Port binding: Specify Later

    • Configure the Request: Connect the orchestration port's Request operation to the Receive shape.

3. How It Works

Untyped messages are a deceptively complex and powerful BizTalk feature. Untyped messages are powerful, because they allow for abstracted processes. For instance, rather than create three processes for three different purchase orders that your company receives from trading partners, you could create a single process that handles the different messages in the same process. Although the single process may increase in complexity, it reduces the amount of maintainable code.

When implementing untyped messages, pay attention to the following areas:

Direct binding: Creating an untyped message that is directly bound to the MessageBox is not recommended. All schema-based messages within BizTalk have a base type of System.Xml.XmlDocument. The implication of this fact is that using a message variable that is typed as System.Xml.XmlDocument will set up a receive subscription for all messages that are received into the MessageBox through the directly bound port. Since, in almost every case, this is not the desired functionality, take caution when implementing this type of scenario.

Casting: Creating an untyped message will negate many of the common operations available for that schema type. For instance, accessing common promoted properties (MessageDataBaseProperties) and using Transform shapes are not supported with untyped messages. It is possible, though, to cast between an untyped message and a typed message. To cast a message, create an instance of the typed message in a Construct/Assignment shape, and assign the untyped message to the typed message. You now have the ability to use the typed message with all associated orchestration functionality.

Promoted properties: Although it is not possible to access common promoted properties (MessageDataBaseProperties) for an untyped message, it is possible to create and access a type of promoted property known as a MessageContextPropertyBase property for an untyped message. Refer to the BizTalk help file for more information about how to create this type of context property within your property schema. Setting the MessageContextPropertyBase property is done in the same manner as setting other promoted properties.

NOTE

MessageContextPropertyBase properties of untyped messages may be set within the orchestration, but the context property cannot be filtered on within other services unless a correlation set containing the MessageContextPropertyBase property is first initialized. In addition, it is not possible to map on a send port, because the MessageType property, which is required to match a message to a map, is not promoted for untyped messages.

By considering direct binding, casting, and promoted properties, you can safeguard your solution from complex bugs that are difficult to identify and triage.

Other -----------------
- Windows Server 2008 R2 : File System Management and Fault Tolerance - Using the Volume Shadow Copy Service
- Windows Server 2008 R2 : File System Management and Fault Tolerance - Backing Up DFS
- Windows Server 2008 R2 : File System Management and Fault Tolerance - Managing and Troubleshooting DFS
- SharePoint 2010 PerformancePoint Services : SharePoint 2010 Filters
- SharePoint 2010 PerformancePoint Services : PPS Filters
- Feature Comparison Between SharePoint Foundation 2010 and SharePoint Server 2010 for Farm Administrators (part 3)
- Feature Comparison Between SharePoint Foundation 2010 and SharePoint Server 2010 for Farm Administrators (part 2)
- Feature Comparison Between SharePoint Foundation 2010 and SharePoint Server 2010 for Farm Administrators (part 1)
- SharePoint Foundation Versus SharePoint Server 2010 : Clarifying the Different SharePoint Products from a High Level
- Exchange Server 2010 Management and Maintenance Practices : Auditing the Environment (part 3) - Message Tracking
 
 
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