Encoding and decoding EDIFACT messages in a Logic App

Camille Schneider
Published by Camille
Category : Azure / Logic Apps
11/03/2021

EDIFACT messages can be processed in a Logic App, either decoding incoming messages or encoding outbound ones. To configure EDIFACT message encoding and decoding, a number of steps must be taken:

  • Add the schema into the integration account
  • Create both partners
  • Configure the agreement
  • Use the agreement in the Logic App

 

Configure the integration account:

Schema

To start the procedure, the first step is to add the schema into the integration account. EDIFACT schemas are available at the following link: EDIFACT schema.

 

Partners

Then, define 2 partners. The first will be the message sender and the second the message recipient.

 

SendPartner

 

Agreement

Lastly, the agreement must be configured. First enter the type of agreement and the two partners (“Host” is the sender, and “Guest” the message recipient).

 

CreateAgreement

 

When receiving a message, the “Receive Settings” need to be configured to indicate the schema being used (i.e. EDIFACT) and the desired validation type.

 

Receive Setting

 

When sending a message, the “Send Settings” need to be configured to indicate the schema being used (i.e. EDIFACT) and all the agreement details by entering the header segments with the version or encoding used.

 

Send Setting

 

Logic App

Once everything is in place in the integration account, a call to the “Encode to EDIFACT” or “Decode EDIFACT” steps in the Logic App is all that is required.

Encode

To encode, the name of the agreement and the XML message to be encoded are the two parameters required.

 

EncodeEdifact

 

Decode

For decoding, the XML message alone is sufficient. The corresponding agreement is found using data in the first segments in the message, such as the partners.

 

DecodeEdifact

 

In conclusion, I find that EDIFACT message handling in Logic Apps is quite well designed. The configuration is fairly comprehensive, and it is easy to process messages, provided they match the associated standard. If this is not the case, it is always possible to modify the XSD schema in order to make it match.