When integrating with GXS OpenText, I recently encountered an issue with an AS2 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=126.96.36.199, 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:
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:
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.
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:
The filter for the one-way send port:
Lesson learned: when sending out asynchronous MDNs, always use one way send ports!
Let me know if this helped you!