Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

BizTalk Enterprise Integration Patterns - Part 1

0.00/5 (No votes)
25 Apr 2006 1  
This article explains the Content Enricher pattern of Message Oriented Systems for BizTalk Server 2004.

Introduction

This article is the first part of the BizTalk Integration pattern series. This article discusses about a simple message oriented systems pattern known as Content Enricher Pattern.

Content Enricher pattern - Setting the context...

In message oriented systems, when a message is sent from a source to the destination, it is common that the destination system requires some additional information in order to process the message correctly. The message received by the destination would contain certain "keys" or identifiers, which can be used to obtain this additional information.

  • The message received by the destination is known as the "Basic Message".
  • The processed message is known as the "Enriched Message".

This pattern discusses about getting that additional information and creating the "Enriched Message".

EnricherPattern

Content Enricher

The Content Enricher uses information inside the incoming message (e.g., key fields) to retrieve data from an external source. After the Content Enricher retrieves the required data from the resource, it appends the data to the message. The original information from the incoming message may be carried over into the resulting message, or may no longer be needed, depending on the specific needs of the receiving application.

Scenario - A Purchase Order request for a Part

Consider a scenario where a Purchase Order request is made for a Part. The Order message would have the fields PartNo and QuantityRequired filled up. The Order schema would look like this...

OrderForm

Note: The Order XML incoming message will have only the fields PartNo and QuantityRequired filled up.

The Enricher Pattern implemented as an Orchestration

Orchestration

A Purchase Order request message is received by the "Receive Shape". Next, a WebRequest message is prepared and a request is sent.

The "Enricher" in this case is a "Web Service", which takes in PartNo and returns all the additional information required by the Orchestration.

Note: The WSPartStore port is the "Enricher" in our example. This is the external data source which provides additional information about the message.

The Web Service request has only the PartNo filled up.

Orchestration

The data received from the Web Service would be used to populate the message, thus "Enriching" the message.

Orchestration

Executing the demo

Input file

InputXML

The input XML file would have only the PartNo and QuantityRequired filled up.

Output file

OutputXML

The output file shall have all the fields filled up.

About the downloadable code

  • Unzip the Web Service with the folder names into the C:\inetput\wwwroot directory and setup the Web Service.
  • Unzip the BizTalk project zip file with the folder names in the C:\ drive.
  • The folder KeyAndBindings contains the Bindings.xml file, which can be imported after the solution is built and deployed.
  • Place the OrderMessage in the In folder and check the Out folder.

Some takeaways

  1. Always select the "WebPortType" created when the "Web Reference" is added to the project while creating "Web Ports" in the Orchestration.
  2. Additional routing logic needs to be written if you would like to send the message to a different port after the Message is populated.

Additional references...

  1. The Architecture Journal - Messaging Patterns in Service Oriented Architecture, Part 2
  2. Enterprise Integration Patterns

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here