Click here to Skip to main content
14,488,687 members

BizTalk Enterprise Integration Patterns - Part 2

Rate this:
3.00 (4 votes)
Please Sign up or sign in to vote.
3.00 (4 votes)
25 Apr 2006CPOL
This article explains the Claim Check Pattern of Message Oriented systems in BizTalk Server 2004


This article is the next part of the BizTalk Integration pattern series. This article discusses message oriented systems pattern known as Claim Check Pattern.

Setting the Context

In message oriented systems, during the processing of large messages we would want to remove uninteresting fields, but only temporarily and then later, when the processing is complete, we would like to add back the removed part of the message. In other words, a message may contain a set of data items that may be needed later in the message flow, but that are not necessarily required, for all intermediate processing steps. So we don't want to carry such huge amount of data in the intermediate steps, which can make debugging difficult or can cause performance degradation.


Scenario - A Store Info Processing Message


Consider a scenario where a StoreInfo processing message needs to be processed. The elements MsgID and MsgContent are the only fields required for processing the message.

The Claim Check Pattern Implemented as an Orchestration


Quick Explanation...

  1. A Store message is received by the activatable "Receive Shape", which activates this orchestration.
  2. The MsgID is extracted from the message and assigned to messageId variable.
    messageId = StoreInMsg.Message.MsgID;


  3. A WebService Request message is formed.

    NOTE: The variable declared in the Web Service is of type XmlDocument and hence it can accept any schema.

    WSRequest.messageId = messageId;
    WSRequest.xDoc = StoreInMsg;
    	("Claim Check Orchestration", "Message ID: " + 
  4. The Web request is sent to the web service and the message is persisted.
  5. The "Decide" shape is used to classify the message as "safe" and "unsafe". This is just an example of some processing logic.
  6. Once the processing is complete, again another Web Request is issued to get back the persisted message.
    WSRequest2.messageId = messageId;
  7. The Web response is now integrated with the processing results and sent to Output Port.
    StoreOutMsg = WSResponse2.RetrieveMessageResult;
    StoreOutMsg.Message.MsgContent = messageContent;
    	("Claim Check Orchestration", "Message Content: "+ messageContent);

The Web Service Code...

The message is stored in the Cache object, using the messageID as the key.

public bool PersistMessage(int messageId, XmlDocument xDoc)
		xDoc, null, Cache.NoAbsoluteExpiration, 
        Cache.NoSlidingExpiration, CacheItemPriority.High, null);
        return true;
        return false;

The message is retrieved from the Cache object, using the messageID as the key.

public XmlDocument RetrieveMessage(int messageId)
        XmlDocument xDoc = (XmlDocument) 
        return xDoc;                
        return new XmlDocument();

Executing the DEMO

Input File


The InputXML file would have a blank MsgContent element.

Event Viewer


Observe the event viewer for the messages.

Output File


The OutputXML file would have a populated MsgContent element.

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 "StoreInfo_1.xml" in the In folder and check the Out folder for the response.

Some Takeaways

  1. Always select the "WebPortType" created when the "Web Reference" is added to the project, while creating "Web Ports" in the Orchestration.

Additional References

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


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Naveen Karamchetti
Architect AT&T Wi-Fi Services
United States United States
Naveen has done his Masters (M.S.) in Computer science, has started his career programming the mainframes and now has more than a decade of programming, development and design experience. Naveen has a sharp eye and keen observation skills. Naveen has worked for several companies and strived hard to build large scale business applications and bringing better solutions to the table.
Quite recently Naveen has built a fairly complex integration platform for a large bank. His hobbies include training, mentoring and research. Naveen spends his free time visiting National Parks nationwide.

Naveen has developed the BizTalk Control Center (BCC)

Comments and Discussions

-- There are no messages in this forum --
Posted 24 Mar 2006


18 bookmarked