X12 EDI Connector 2.5 - Examples - Mule 4

Use this example to view the use case for Business-to-Business (B2B) EDI integration leveraging Anypoint X12 Connector. This example:

  • Transforms XML messages into outbound EDI X12 850 purchase order transactions

An HTTPS Listener source receives the enterprise purchase order XML messages from a backend system. DataWeave and X12 Writes translate the XML message into an X12 v4010 850 purchase order EDI message.

  • Transforms Inbound EDI X12 850 purchase orders into JSON

An HTTP Listener source receives the raw EDI X12 850 purchase order message. X12 Read and DataWeave components pare and translate the EDI data into the JSON format.

  • Generates a Functional Acknowledgment (997)

Prerequisites

  1. Open the Transform XML to EDI X12 850 purchase orders and X12 850 to JSON example in Anypoint Studio from Anypoint Exchange Examples.

  2. Install the latest version of Anypoint X12 Connector.

Run and Test the Outbound XML to EDI X12 850

  1. Run the application in Anypoint Studio.

  2. Test the outbound flow by using a REST Client to post a request (POST) to a JSON message to the URL:

You see the payload location under the following directory:

src/main/resources/outbound/Enterprise-Outbound-PO.xml

The Mule app returns the generated EDI X12 850 transaction.

Run and Test the Inbound EDI X12 850 to JSON

  1. Test the inbound flow using a REST Client to post a request (POST) to a raw EDI X12 850 message to the URL:

    You see the payload location under the following directory:

    src/main/resources/inbound/EDI-4010-850-NTO-to-Mythical.edi

    The app returns the translated JSON purchase order message.

    A Functional Acknowledgement (997) is generated and sent to the log.

  2. Send the message back to the trading partner via any standard protocol, such as FTP, SFTP, or AS2.