Tracking AS2/MDN messages in BizTalk

Recently, we were stuck trying to track specific AS2 EDI message exchanges within BizTalk. While configuring BizTalk EDI, if you enable the BAM options, things get much easier-

https://msdn.microsoft.com/en-us/library/bb743506.aspx

Now, if you enable AS2 reporting, the data will move into some AS2 specific BAM activities-

1

Another reporting option to enable is at the EDI agreement level-

https://msdn.microsoft.com/en-us/library/bb226464.aspx

2

With these in place, you will get couple of BAM activities specific to AS2 that I found very helpful to track specific AS2 transactions.

  1. [BAMPrimaryImport].[dbo].[bam_AS2MessageActivity_Completed] – to track all AS2 messages
  2. [BAMPrimaryImport].[dbo].[bam_AS2MdnActivity_Completed] – to track/correlate the MDNs for the associated AS2 inbound messages.

For example, in this case we were looking for a specific inbound AS2 file, you can filter on different attributes as well, say for a specific timestamp, or a specific MessageID from the AS2 headers (note that the timestamp in this table is BizTalk runtime server local time)-

select * from [BAMPrimaryImport].[dbo].[bam_AS2MessageActivity_Completed] where filename¬† like ‘%ABC123%’ –

as2

There’s a MessageID field in above table with which you can check/correlate the MDN you may have sent to your partner for a particular AS2 message in the bam_AS2MdnActivity_Completed.

Another word, as with BAM activitites, I only referred to the _Completed tables here, but your data may reside in the _Active tables as well, depending on activity completion.

The MSDN documentation on these BAM activities can be found here-

https://msdn.microsoft.com/en-us/library/bb743626.aspx

Hope this helps !

Arindam.