Altova FlowForce Server 2026 Advanced Edition

Full path: /system/as2/send

 

The as2/send function sends an AS2 message to a remote AS2 server. To be able to call this function from a job, you must first configure the AS2 partner's details in FlowForce Server. For general information about AS2 integration and usage, see AS2 Integration.

 

The function returns an AS2 MDN object which encapsulates the actual MDN returned by the server and auxiliary information from the protocol. To get additional information from the AS2 MDN object (e.g., the HTTP status or the MDN of the original message), add an execution step that calls the required AS2 expression functions.

 

To find out more about how the as2/send function is used in jobs, see Send AS2 Messages.

 

HTTP headers

When sending an AS2 message, FlowForce Server sets HTTP headers in accordance with the AS2 Specification. The actual headers depend on the configuration of the send function, partner configuration, and other parameters (details below).

 

Fixed headers:

 

MIME-Version: 1.0

AS2-Version: 1.2

EDIINT-Features: multiple-attachments

From: as2@example.com

Subject: AS2 Request

 

Depending on the partner configuration in /system/as2/send:

 

AS2-From: P2  (from the AS2 Partner configuration page, Local Side Settings/AS2 Name)

AS2-To: P1 (from the AS2 Partner configuration page, Local Side Settings/AS2 Name)

 

From the /system/as2/send parameter or auto-generated if not given:

 

Message-ID: <20201123192334591017-31ca0d9e1b654f7294b10624d1ab5075@DEV-ABC>

 

Depending on the partner configuration (encryption and/or signature), the required MIME headers are added:

 

Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name="message.p7m"

Content-Disposition: attachment; filename="message.p7m"

 

If the setting Message Disposition Notification/Request Signed MDN is checked on the AS2 Partner page, the following header is added:

 

Disposition-Notification-To: as2dummy@example.com

 

Using the HTTP Headers parameter (described in the table below), you can set additional headers before sending the message and overwrite the default value of the Subject header.

 

Parameters

Name

Type

Description

Partner

AS2 Partner

Mandatory parameter. References the AS2 partner object (see Configuring AS2 Partners).

Message

stream

Mandatory parameter. The content of the AS2 message to send, as a stream object. The stream required by this field can be converted from a file (for example, XML or EDI file) by means of a FlowForce Expression, for example:

 

stream-open("C:\files\myfile.edi", "application/EDIFACT")

 

Notice that the stream-open function above also supplies the message Content-Type header as second parameter. Other values for Content-Type can also be used if necessary.

 

For an introduction to expressions in FlowForce, see Expressions.

Message ID

string

Optional parameter. This field provides the value of the Message-ID header field, as a string. To generate this value, call the new-message-id expression function.

HTTP Headers

sequence of (string, string)

Optional parameter. This parameter enables you to overwrite the default value of the Subject header (AS2 Request) and set additional headers beyond those required by the AS2 Specification. For example, you might want to include a header like X-Cyclone-Metadata-FdaCenter for sending messages to FDA.

 

You cannot use this parameter to overwrite the headers required by the AS2 Specification, except for the Subject header.

Abort on error

Boolean

Optional parameter. This parameter determines the outcome of a job in which an error has occurred. If the Abort on error parameter is true, job execution will be terminated. If the Abort on error parameter is false, FlowForce Server will ignore errors and continue job execution. The default value is true.

 

Examples

See the following examples:

 

Example: Full AS2 Message Exchange (Simple)

Example: Full AS2 Message Exchange (Advanced)

 

© 2019-2025 Altova GmbH