Nav

AS2 and EDI X12 Purchase Order WalkThrough

This page shows how a company can use Anypoint Partner Manager (APM) to manage and track B2B processes. You will develop a Mule application that:

  1. Transforms an XML purchase order read from the company’s filesystem to an X12 850 document

  2. Sends the 850 to a supplier over AS2

  3. Listens for (on an AS2 endpoint) and receives an X12 997 document that identifies whether the 850 was accepted or rejected

APM manages and records all B2B exchanges.

B2B_AS2EDI_01

Audience

This document is intended for a technical audience with basic knowledge of Anypoint Platform, including:

Setting up a Partnership

The first step in building the solution is to create a partnership in Anypoint Partner Manager between your organization and a supplier.

In this walkthrough, we show an example in which you initiate an order from a supplier, but APM works equally well when a customer is ordering from you.

A partnership:

  • Identifies your company

  • Identifies your partner

  • Establishes the parameters by which B2B data is exchanged between you and your partner

  • Allows this data to be tracked and viewed from Anypoint Partner Manager

Get Started

  1. Start APM. The B2B Transactions Page appears.

  2. In the left-hand navigation pane, click Trading Partners. The Trading Partners page appears.

img-trading-partners
Figure 1. Trading Partners Page

Configure Home Company Identifiers

  1. On the Trading Partners Page, click the top partner (Your company) in the Trading Partners list.
    The Company Information Page appears.

  2. On Company Information Page, click Identifiers.
    The AS2 Identity Settings Page appears.

  3. In the AS2 Identity field, enter MOUNTAINOUT, then click Save.

  4. In the left navigation pane, in the FORMAT DEFAULTS section, click X12.
    The X12 Identity Settings Page appears.

  5. In the Interchange ID (ISA), enter MOUNTAINOUT

  6. From the Interchange ID qualifier (ISA), Select ZZ (Mutually Defined).

  7. Click Save.

Create and Configure a Partner

In this section, you will:

  • Create a trading partner

  • Configure the partner’s AS2 and X12 identities

  • Set the runtime parameters with which the AS2 Connector and X12 Module operate when sending to the supplier or receiving from that supplier

Create a Partner

  1. At the top of the left navigation pane, click Trading Partners.
    The Trading Partners Page appears.

  2. In the top right corner, click New Partner .

  3. In the Company Name field, enter MY-SUPPLIER.

  4. Click Save.

Create an AS2 Identity

  1. In the left navigation pane, click Identifiers.
    The AS2 Identity Settings Page (for the partner you created in [Create Partner]) appears.

  2. In the AS2 Identity field, enter MY-SUPPLIER.

  3. Click Save.

Configure an AS2 Endpoint

  1. In the left navigation pane, in the CONFIGURATION section, click Endpoints.
    The Endpoints Page appears.

  2. In the top right of the Endpoints Page, click New.

  3. In the Endpoint section, enter the following values in the corresponding fields:

    Field

    Value

    Name

    AS2 Send

    Protocol

    AS2

    Type

    Send

    Default

    TRUE

  4. Verify that Default for My Supplier is checked.

  5. In the Settings section, enter the following values in the corresponding fields:

    Field

    Value

    URL

    http://localhost:8081

    MDN Required

    TRUE

  6. Press Save.

  7. In the top right of the Endpoints Page, Click New.

  8. In the Endpoint section, enter the following values in the corresponding fields:

    Field

    Value

    Name

    AS2 Receive

    Protocol

    AS2

    Type

    Receive

    Default

    TRUE

  9. Verify that Default for My Supplier is selected.

  10. In the Settings section, enter the following values in the corresponding fields:

    Field

    Value

    URL

    http://localhost:8082

    Default

    TRUE

  11. Click Save.

  12. In the left navigation pane, click Endpoints.

Configure an X12 Endpoint

  1. On the left navigation pane, under FORMAT DEFAULTS, click X12.

  2. Enter MY-SUPPLIER as Interchange ID (ISA), Select ZZ (Mutually Defined) from the Interchange ID qualifier (ISA).

  3. In the Inbound section, enter the following values in the corresponding fields:  

    Field

    Value

    Interchange sender ID qualifier  (ISA 05)

    ZZ

    Interchange sender ID (ISA 06)

    MY-SUPPLIER

    Require unique GS control numbers (GS 06)

    FALSE

  4. In the Outbound section, enter the following values in the corresponding fields:

    Field

    Value

    Interchange receiver ID qualifier (ISA 07)

    ZZ

    Interchange receiver ID (ISA 08)

    MY-SUPPLIER

    Repetition separator character (ISA 11)

    U

    Default Interchange usage indicator (ISA 15)

    Test

    Component element separator character (ISA 16)

    >

    Segment terminator character

    ~

    Data Element Delimiter

    *

    Character set

    Extended

    Character encoding

    ASCII

    Line ending between segments

    LFCR

    Require unique GS control numbers (GS 06)

    TRUE

  5. Click Save.

Identify or Create an API Key

In order to create a Mule project, you must enter an API Key and an Environment ID.

If you have an existing API Key, use it. If you do not know the API Key, consult your organization’s MuleSoft administrator.

If your organization has not created an API Key, you can use APM to create one.

The API Key is used by every Mule application across your entire Master Organization that communicates with Anypoint Partner Manager. Therefore, before you create a new API Key, coordinate with your organization’s MuleSoft administrator to ensure that none of your organization’s processes are using an existing API Key because, if they are, creating a new API Key will cause them to cease functioning. In that case, instead of creating a new API Key, use the existing API Key.

To obtain a key, see Create a New API Key.

You can determine your environment ID on the same page that you create a new API key.

Setting up an Anypoint Studio Project

  1. Download and unzip the as2-x12-walkthrough.zip application.

  2. In Anypoint Studio, click File.
    The File Menu appears.

  3. On the File Menu, click Import.
    The Import Source Selection Window appears.

  4. In the Import Source Selection Window, select Anypoint Studio Project from External Location.

  5. Click Next.
    The Import Mule Project Window appears.

  6. In the Import Mule Project Window, select the downloaded application.

  7. Click Finish.

  8. Click the file customer.xml in the app directory, and select the Global view tab. Double-click the B2B global element configuration and insert the API key you created from Anypoint Partner Manager.

Running the Application

  1. Right-click on the project directory as2-x12-walkthrough.

  2. On the right-click menu, click Run As, then click Mule Application.
    On startup, the application creates an outbox folder in the project’s root directory. If the outbox directory isn’t visible, refresh the project in the Package Explorer view.

  3. The project includes a file named po.xml in the src/test/resources folder. Copy po.xml, then paste it in the outbox folder.
    The application processes the pasted file, then deletes it.

  4. In Anypoint Manager, in the left navigation pane, click B2B Transactions
    The B2B Transactions Page appears.

img-b2b-transactions-wt
Figure 2. B2B Transactions Page

The B2B Transactions Page should confirm that:

  • An XML purchase order was read from the company’s filesystem and transformed to an X12 850 document.

  • The 850 was sent to a supplier over AS2.

  • The link:/anypoint-b2b/as2-connector listened for (on an AS2 endpoint) and received an X12 997 document that identifies whether the 850 was accepted or rejected.

For more information, see: