Recently, a client was updating their message processing system from a collection of old VB6 applications to a BizTalk Server 2009 solution. One of the processes that they struggled with was updating their “special case” partners. I call these partners “special case” because they could not or would not adhere to the standardized schema for acknowledgment messages that was provided.
Each “special case” partner had their own message type, which changed without notice. The only thing that each had in common was that they agreed to put an acknowledgment bit somewhere within their return message. The placement of this acknowledgment bit was establish many years ago when the VB6 applications where written. The problem of extracting the bit was solved within the VB6 applications and the code was simply updated to C# to leverage the existing solution.
The other issue that was occurring is that each acknowledgment message had a different format, and non of them were valid XML. Most of the acknowledgments were actually screen scrapes from HTML pages with multiple root nodes and the message stuffed in at various places. BizTalk does not like to consume messages that have no schema/message type. To solve this issue, I had the client run the Flat File Schema Wizard to generate a Flat File Message with a single node and the entire contents of the message as its value (contained within CDATA markup to prevent corruption). The trick with this approach is the delimiter used to define the records. Since we only ever want one record, we need to choose a delimiter that has a very, very low probability of showing up in the incoming message. The delimiter I chose to use was “|abcdefghijklmnopqrstuvwxyz|”.
Now that the message was being consumed, it was a simple matter to use xpath to extract the string payload of the message and send it over to the existing C# helpers that know how to process it.