BizTalk AS2: asynchronous MDN error with 202 Accepted

When integrating with GXS OpenText, I recently encountered an issue with an AS2 setup.

Setup

  • You receive an inbound message over AS2.
  • The AS2 client is setup to receive an asynchronous MDN regardless of the use of a encryption/signing or compression.
  •  You’ve setup a two-way send port to send out the asynchronous MDN.
  • The two-way send port uses AS2Send and AS2Receive pipelines.

With this setup, we encountered the following AS2 error:

An output message of the component “Microsoft.BizTalk.EdiInt.PipelineComponents” in receive pipeline “Microsoft.BizTalk.EdiInt.DefaultPipelines.AS2Receive, Microsoft.BizTalk.Edi.EdiIntPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” is suspended due to the following error:
An AS2 message was received that did not contain the AS2-From header..
The sequence number of the suspended message is 2.

If you take a look at the details of the message, you can see the following body:

202 Accepted

202

Cause

In a way, this makes perfect sense: In our specific case, the two-way send port we are using to send the MDN, was also used to send our payloads to the other party (in our case GXS).

This was our original send port filter:

filter_original

In the case where we send the payload (first part of the filter), the two-way send port is needed: we send out our payload message via the AS2Send send pipeline to receive a synchronous MDN back via the AS2Receive receive pipeline. The MDN, which is the HTTP response message, contains AS2 headers like AS2-From and AS2-To, as needed by the AS2 protocol.

In the other case (second part of the filter), where we send out our asynchronous MDN, we send out the MDN via the AS2Send send pipeline, but receive a HTTP 202 Accepted in the response. Obviously this doesn’t contain the correct HTTP AS2 headers, but it does get processed by the AS2Receive receive pipeline, which returns the error, because it needs the AS2 headers to be able to match it to the correct agreement.

Solution

The solution is quite simple: instead of one two-way send port, we split it up into two send ports:

  • one two-way send port to send out the payload message and receive the synchronous MDN.
  • one one-way send port to send out the asynchronous MDN, where we don’t have the AS2Receive receive pipeline, so the HTTP 202 Accepted doesn’t get processed by BizTalk in an incorrect way.

The filter for the two-way send port:

twowayfilter

The filter for the one-way send port:

onewayfilter

Lesson learned: when sending out asynchronous MDNs, always use one way send ports!

 

Let me know if this helped you!

Cheers,
Pieter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s