Posts

Non-Uniform Sequential Convoys in BTS 2004 using Correlation

Image
This is another primer on Sequential Convoys, but non-uniform ones this time. With a uniform Sequential Convoy, correlated messages have to be of the same type. But there might be situations where we would want to implement Sequential Convoys with different messages. The sample below illusatrates this concept by taking 2 messages of different types, and merging them to produce 1 output message. The input messages are correlated into a single orchestration instance by a promoted property called "Primary". Non-Uniform Sequential Convoy Most information in my previous post about Uniform Sequential Convoys holds true in this case too. You can get the source files here Post a comment if you need any clarifications.

Using XmlSerializer in the BizTalk Web Service Proxy.

This is something that most people will be aware of but might be helpful for newbies. The BizTalk Web Services Publishing Wizard, creates new datatypes for input and output messages during creation of the Web Service that exposes Orch/Schemas. Adding a web reference to this web service will generate the same datatypes, whose definitions can be found in the Reference.cs file. If the external system already generates XML, creating the input message object can be a drag. A quick way of creating the input message objects from XML and converting the output message objects to XML, is by using the XML Serializer class. Here's the sample code. //creating a new RequestMsg objectRequestMsg objRequestMsg = new RequestMsg(); //Create an XML Serializer for RequestMsg document XmlSerializer serRequestMsg = new XmlSerializer(objRequestMsg.GetType(), " http://schemas.devdutt.com/XMLSchema/v1/InputMsg.xsd "); //Deserializing XML into RequestMsg class //strRequestMsgXml is ...

Using recursion in the In-line XSLT Template type Scripting Functoid

People using In-Line XSLT Templates in their scripting functoids often run into the need for looping, WITHOUT using an <xsl:for-each> . An example in the BizTalk context would be, if you had a comma separated string in the source schema and wanted to tokenize it into multiple destination schema elements. The following XSLT template does that for you. <xsl:template name="TokenizeCommaSepString"> <xsl:param name="stringToTokenize" /> <xsl:param name="destinationElementName" /> <xsl:if test="$stringToTokenize != ''"> <xsl:choose> <xsl:when test="contains($stringToTokenize, ',')=0"> <xsl:element name="{$destinationElementName}"> <xsl:value-of select="$stringToTokenize" /> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:element name="{$destinationElementName}"> <xsl:value-of select="substring-be...

Sending Messages as FORM Variables with the HTTP Adapter

Image
Here's a quickie. If you want to send a message, as a FORM Variable in a HTTP request, this is what you do: 1) Set the Content Type property of the HTTP send port, to application/x-www-form-urlencoded . 2) Create a custom pipeline and plug-in a Custom Pipeline Component, that pre-pends Variable-Name = in front of the message, and url encode it. e.g: ClaimPacket= 3) Use this pipeline with your HTTP send port, and you are done! Post a comment for a sample. Update : Screen shot of the Content Type property:

Event Log Message Interception with WMI

Out of the box pipeline components have decent error logging, but often don't give us the flexibility to do our own thing. In addition to a suspended queue listener (see Martinjn's blog), an Event Log Watcher windows service might be a good failover mechanism. Below is some skeleton code for going about it. using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Management; using System.IO; namespace MyEventLogWatcher { public class BizTalkEventLogWatcher : System.ServiceProcess.ServiceBase { private System.Management.ManagementEventWatcher eventLogWatcher; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public BizTalkEventLogWatcher() { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); } static void Main() { System.ServiceProcess.ServiceBase ServiceToRun; ...

Uniform Sequential Convoys in BTS 2004 using Correlation

This orchestration is a small primer if you want to implement a "Sequential Convoy " with BizTalk 2004. You would want to do this if: a) You have to force messages coming in at a particular port to correlate together and get processed by the same orchestration instance. (Correlation with multiple ports is a topic of a subsequent post) b) You want your output messages to be delivered in the same order that the orchestration got them. c) Some pipeline components you use, take one message but give out multiple messages, but you want to process these multiple messages together. For eg: the HIPAA and HL7 disassembler components. ...and probably some more scenarios that I can't think of right now. The attached orchestration correlates messages w.r.t ReceivedFileName (think about the HIPAA 835 scenario mentioned above). You can use whatever correlation parameters you desire. TIP: Whatever properties you choose to correlate the incoming messages with, make sure tha...