I got a scenario, where the need was to get message processed by BizTalk Server 2006. After some googling, I came accross a good post from Thiago Almeida. According to Thiago, there are three methods of extracting message body from BizTalk Server.
This DLL, the BizTalk Database Acessor, is unmanaged and does a lot of work for BizTalk including accssing the BizTalk databases to send and receive messages.
The bts_GetTrackedMessageParts stored procedure inside the tracking database expects the message GUID and will return the compressed message data back. We can then use reflection to invoke the Decompress method of the Microsoft.BizTalk.Message.Interop.CompressionStreams class inside Microsoft.BizTalk.Pipeline.dll to decompress the data returned from SQL..
Use the WMI MSBTS_TrackedMessageInstance. SaveToFile method to save the instance to disk. This was the popular method in BizTalk 2004 since there was no operations dll then.
All we need to get message from tracking database are message guid, tracking db name and server.