Posts

Showing posts from 2004

The South-East Asia Earthquake and Tsunami

Totally off topic but very important nevertheless. For those of you who wish to find the right places to contribute towards the Relief Operations for Tsunami victims in South-Asia, please visit the following link. The South-East Asia Earthquake and Tsunami

Getting the BizTalk SQL Server DB Name

A quick one. How to get the name of the SQL Server that BizTalk is running? A relatively easy way is to get it from the registry. Heres a code sippet that does just that. string strBtsSvrSubKey = "Software\\Microsoft\\BizTalk Server\\3.0\\Administration"; string strBtsSqlSvrKey = "MgmtDBServer"; Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(strBtsSvrSubKey); string strBtsSqlSvrName = key.GetValue(strBtsSqlSvrKey).ToString(); Any queries, post a comment.

HIPAA Accelerator 3.0 Error deciphering

The BizTalk Accelerator for HIPAA 3.0 throws up a mighty detailed error in the event log when it fails during Xml to EDI translation and/or validation. These errors tend to look a little scary (they scared me at the very least). An example would be : Status report details: SRH DevBT03 200411122204111 DEFAULT 2 DEFAULT SRM 00000000 00010168 101 0 837 004010HC09translate failed 0000010000010000000000010 10168 SRE 0010 30 ProcessSegment 00053 000 TS837Q1_2420A_NM103__RenderingProviderLastOrOrganizationName source format: [101 0 ,XML 1.0]\r\nsource document: [837 004010DEFAULT X X098A1,Health Care Claim: Professional]\r\nsource segment: [data#53,def#232,name=TS837Q1_2420A_NM1_RenderingProviderName]\r\nsource element: [def#4,elm#0,comp#0,name=TS837Q1_2420A_NM103__ RenderingProviderLastOrOrganizationName], (msgnr:1 segnr:53)(line:2 pos:11671 filepos:11953) Look for the last numeric code following the SRE element. In this case its 001030. Ignore the 0010 part and you are left with

HIPAA Accelerator 3.0 Gotchas

I stumbled across a couple of things w.r.t the BTS 2K4 and the HIPAA Accelerator 3.0, which I feel are worthy of a mention. SQL Server 2000 client components are needed on the BizTalk boxes when SQL Server 2000 is installed on a separate box. DTC (Distributed Transaction Coordinator) must be enabled for Network Access (via Windows Component Setup) on all computers participating in the configuration, administration and message processing. The user under which the HIPAA EDI windows service is configured to run, must be a member of the BizTalk Application Users group. All HIPAA 3.0 schemas should be validated using the XSD2EDI utility located at ......Program Files\Microsoft BizTalk Accelerator for HIPAA 3.0\HIPAA_EDI\Subsystem at least once (on all BizTalk boxes where HIPAA is installed) before the HIPAA Accelerator can start processing messages. For multi-box BizTalk Installations you might want to consider making the HIPAA Documents Home directory a network share. For ANSI 835p th

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