Contact Free trial Login

AS2 Connector

Support Category: Premium

The Mule Runtime supports the AS2 protocol through the AS2 Connector. The AS2 connector enables trading partners transmit and receive AS2 messages with EDI-X12, EDIFACT, XML or binary payloads.

This connector leverages the AS2 protocol, allowing Mule applications to:

  • Send messages, signed or unsigned, over HTTP or HTTPS, following the AS2 protocol.

  • Receive messages, also over HTTP or HTTPS, following the protocol.

This document assumes that you are familiar with AS2, Mule, Anypoint Connectors, and Anypoint Studio.

For hardware and software requirements, see the Connector Release Notes.

How to Install

  1. In Anypoint Studio, click the Exchange icon in the Studio task bar.

  2. Click Login in Anypoint Exchange and supply your Anypoint Platform username and password.

  3. Search for the connector and click Install.

  4. Follow the prompts to install the connector.

This connector requires Java Cryptography Extension (JCE) installed on your Java runtime.

About the Connector Namespace and Schema

In Anypoint Studio, when you drag the connector from the palette onto the Anypoint Studio canvas, Studio automatically populates the XML code with the connector namespace and schema location.

Namespace: http://www.mulesoft.org/schema/mule/as2
Schema Location http://www.mulesoft.org/schema/mule/as2/current/mule-as2.xsd

If you are manually coding the Mule application in Studio’s XML editor or another text editor, define the namespace and schema location in the header of your Configuration XML, inside the <mule> tag.

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:as2="http://www.mulesoft.org/schema/mule/as2"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	    xsi:schemaLocation="http://www.springframework.org/schema/beans
	    http://www.springframework.org/schema/beans/spring-beans-current.xsd
        http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
        http://www.mulesoft.org/schema/mule/as2
	http://www.mulesoft.org/schema/mule/as2/current/mule-as2.xsd">
      <!-- put your global configuration elements and flows here -->

</mule>

Note: Use current in the schema path. Studio interprets this to the current Mule version.

To Configure the Connector Global Element

Place the connector in your flow as applicable for your use case.

To use the AS2 connector in your Mule application, create a global AS2 element for use by the AS2 connector. The AS2 connector provides the following global configuration parameters:

Key Description

Partner From - Name

Sender partner’s name.

Partner From - AS2 id

Sender partner’s ID.

Partner From - x509 alias

Sender alias as defined in the certificate file.

Partner From - Email

Sender partner’s email.

Partner To - Name

Receiver partner’s name.

Partner To - AS2 id

Receiver partner’s ID.

Partner To - x509 alias

Receiver alias as defined in the certificate.

Partner To - Email

Receiver partner’s email.

Partnership - Sender

The sender’s name.

Partnership - Receiver

The receiver’s name.

Partnership - Subject

The text used in email subject line.

Partnership - AS2 URL

The partners AS2 server’s URL.

Partnership - AS2 Receipt Option

The URL that the partner sends the MDN.

Partnership - Encrypt

The encryption algorithm for email header.

Partnership - Sign

The sign encryption of the message. None by default (message is not signed).

Partnership - Content transfer encoding

The content transfer encoding. Binary by default.

Partnership - Compression type

The compression type. ZLIB is the only supported compression/decompression. Disabled by default.

Partnership - Remove CMS algorithm protection attrib

Disable the OID from being sent.

AS2 Keystore - Keystore Path

The path of the keystore.

AS2 Keystore - Keystore Password

The password of the keystore.

Receive Module Ports - Receiver Port

The port used by the receive source.

Receive Module Ports - Secure Receiver Port

The secure port (SSL) used by the receive source.

Receive Module Ports - Secure Receiver Keystore Path

The path of the keystore with the SSL certificate for the receiver source.

Receive Module Ports - Secure Receiver Keystore Password

The password of the keystore.

MDN Receiver Module Ports - Receiver Port

The port for the MDN receiver.

MDN Receiver Module Ports - Secure Receiver Port

The secure port (SSL) for the MDN receiver.

MDN Receiver Module Ports - Secure Receiver Keystore Path

The path of the keystore with the SSL certificate for the MDN receiver.

MDN Receiver Module Ports - Secure Receiver Keystore Password

The password of the keystore.

Operations

  1. Send: Sends a message through HTTP or HTTPS using the AS2 protocol.

  2. Receive: Source that receives messages via HTTP or HTTPS using the AS2 protocol.

Using the Connector

To configure the connector you have to complete the connector’s global element properties with the required elements as described above.

AS2 Global Element Properties

You can set placeholders in each property and define them in the mule-app.properties file.

Example of a Send Use Case

AS2 Use Case 1 flow
It is not possible to specify both receiver and secured receiver module ports.

Example of a Receive Source Use Case

AS2 Use Case 2 flow