Contact Free trial Login

AS2 Connector - Mule 4

Support Category: Premium

AS2 Connector Version 4.1

Mule supports the AS2 protocol through the AS2 Connector. The AS2 connector enables trading partners to 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.

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

Add the Connector to Your Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the Studio taskbar or from the Mule Palette view.

Add the Connector Using Exchange

  1. In Studio, create a Mule project.

  2. Click the Exchange icon (X) in the upper-left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for "as2".

  5. Select the connector and click Add to project.

  6. Follow the prompts to install the connector.

Add the Connector in Studio

  1. In Studio, create a Mule project.

  2. In the Mule Palette view, click (X) Search in Exchange.

  3. In Add Modules to Project, type "as2" in the search field.

  4. Click this connector’s name in Available modules.

  5. Click Add.

  6. Click Finish.

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>
Use current in the schema path to use the current Mule version.

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.

See Also