Overview
The project had to receive and send EDI messages (EDIFACT) from/to partners using the AS2 protocol. It used a publish-subscribe architecture built on our framework which handles all the message routing and monitoring of the message flow via a dashboard.
Process
Each inbound AS2 message had to be signed and encrypted by the partner and an asynchronous Message Disposition Notification (MDN) returned. To enable this, the following was added to the integration account:
- A Trading Partner was created for each partner.
- An AS2 Trading Partner Agreement was created between the customer and each partner.
- Each partner’s public certificate which was used for message signature validation.
- The customer’s private key which was used for decryption. This key also needs to be added to an Azure Key Vault.
MDN settings can be found in the agreement in both the Receive and Send sections:
For inbound messages, a publish logic was created and actions were added to decode the AS2 message, determine if a MDN is required and if so, send it asynchronously or synchronously:
Finally, the message was decoded using the Decode EDIFACT action, transformed using an XLST map in the integration account before being sent to Oracle NetSuite via an Azure Function:
For outbound messages, these were first transformed using an XSLT map before being encoded to EDIFACT and then encoded using the AS2 Encode action:
Inbound MDN failures
One issue was with inbound messages that occurred when sending the MDN back asynchronously. It would fail on the partner’s end. After some investigation it was found this was because of the Logic app headers that are returned in the response. The solution was to add a policy to the APIM operation to remove the following headers:
Outbound MDN failures
For outbound, the issue occurred when the encrypted AS2 message was sent to the partner. They were seeing a decryption error. After investigation it was found that the message needed to be converted from a base64-encoded string to application/octet-stream using the base64ToBinary converter function:
Once this was added, the messages were processed successfully and an MDN sent back from the partner.
I hope this blog has given some insight into how logic apps can be used in an EDI solution as well as to highlight some of the MDN issues that might be encountered.
Thanks!
Subscribe to our RSS feed