Nav

FTPS 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 FTPS

  3. Listens for (on an FTPS 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-partner-configuration
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, in the left-hand navigation pane, click Identifiers.
    The Identifiers Page appears.

  3. On the Identifiers Page, click New.
    The Identifier Page appears.

  4. On the Identifier Page, click the down-arrow in the Type dropdown listbox, then click AS2.
    The AS2 Identity box appears.

  5. In the AS2 Identity box, enter MOUNTAINOUT, then 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. On the Trading Partners Page, click Create new partner.
    The Company Page appears.

  2. In the Company Name box, enter MY-SUPPLIER.

  3. Click Save.

Configure FTPS

Create a Send Endpoint

  1. In the left-hand navigation pane, in the CONFIGURATION section of the left-hand navigation pane, click Endpoints.

  2. In the top right, Click New.

  3. In the Endpoint section, fill in the fields as shown in the table below:

    Field

    Value

    Name

    FTPS Send

    Protocol

    FTPS

    Type

    Send

    Default

    TRUE

    If you do not enter a value in the Name box, APM populates the box with a name that combines the Protocol, the Type, and the Partner Name. If you choose to enter a different name, consider that the name should lend itself to recognition in the context of being selected in other APM contexts.
  4. Make sure Default for My Supplier is checked.

  5. In the Settings section, enter values as shown in the following table:

    Field

    Value

    Server Address

    Address for the server you want to use

    Port

    Number of the port for your server (typically 21)

    User Name

    Username for the account you created on the FTPS cloud service you procured in Step a

    Path

    Path you want to use in your server

  6. Click Save.

Create a Receive Endpoint

  1. In the left-hand navigation pane, click Endpoints.

  2. In the top right, Click New.

  3. In the Endpoint section, fill in the fields as shown in the table below:

    Field

    Value

    Name

    FTPS Receive

    Protocol

    FTPS

    Type

    Receive

    Default

    TRUE

    If you do not enter a value in the Name box, APM populates the box with a name that combines the Protocol, the Type, and the Partner Name. If you choose to enter a different name, consider that the name should lend itself to recognition in the context of being selected in other APM contexts.
  4. Verify that Default for My Supplier is checked.

  5. In the Settings section, enter values as shown in the following table:

    Field

    Value

    Server Address

    Address for the server you want to use

    Port

    Number of the port for your server (typically 21)

    User Name

    Username for the account you created on the FTPS cloud service you procured in Step a

    Path

    Path you want to use in your server

  6. Click Save.

Copy your Environment ID

  1. On the Transaction Monitoring Page, in the left-hand navigation pane, click Administration, then click Environments.

  2. In the row that corresponds to the environment with which you are working, click copy.

Identify or Create an API Key

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

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

For information about using Anypoint Studio, see Anypoint Studio.

  1. Download ftps-x12-walkthrough.zip.

  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 generated Deployable Archive (.zip).

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

  6. In the Import Mule Project Window, browse to the location to which you downloaded the archive (in Step 1), then select the archive and click Open.
    The Project Name box auto-populates.
    NOTE: The Project Name must be unique with respect to any previously-imported projects. If it is not, Finish will not be enabled. If this is the case, change the Project Name so that Finish is enabled.

  7. Click Finish.
    The project appears in the Anypoint Studio Package Explorer pane.

  8. In the project (expand if necessary), expand the src/main/app, double-click mule-app.properties.
    Project properties appear in the Anypoint Studio Canvas.

  9. In Line 1, api.key = NEED_TO_FILL_IN, replace NEED_TO_FILL_IN with the API Key from Identify or Create an API Key.

  10. In Line 2, environment.id = NEED_TO_FILL_IN, replace NEED_TO_FILL_IN with the environment ID from Copy your Environment ID.

  11. In Lines 6-9, replace NEED_TO_FILL_IN with the values you entered for the boxes that correspond to these settings in Configure FTPS.

  12. In Anypoint Studio, click File, then click Save All.

Running the Application

  1. In Anypoint Studio, right-click the project.

  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 Transaction Monitoring
    The Transaction Monitoring Page appears.

img-transaction-monitoring
Figure 2. Transaction Monitoring Page

The Transaction Monitoring 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 FTPS.

  • The FTPS Connector listened for (on an FTPS endpoint) and received an X12 997 document that identifies whether the 850 was accepted or rejected.

For more information, see: