Altova FlowForce Server 2024 Advanced Edition

In jobs that receive AS2 messages, you can call the as2-partner-remote-name function to get the name of the sending AS2 partner. This is the AS2 name defined in Partner Settings on the AS2 partner configuration page.

 

To extract an AS2 partner's name, add an execution step that calls /system/compute-string or /system/compute. For /system/compute-string, enter the following expression: {as2-partner-remote-name(partner)}. For /system/compute, enter the following expression: as2-partner-remote-name(partner). In both expressions, partner is the name of the input parameter of type AS2 partner. For more information about extracting the name of an AS2 partner, see the example below.

 

Signature

as2-partner-remote-name(partner as AS2 Partner) -> xs:string

 

Parameters

Name

Type

Description

partner

AS2 Partner

Specifies the object of type AS2 Partner from which the remote name will be extracted.

 

Example

When you configure a job as an AS2 service, information about the AS2 partner and the message they have sent becomes automatically available as partner and message job input parameters (screenshot below). The job illustrated below shows how to extract the name of an AS2 partner and send a notification about a new AS2 message. The job has three execution steps (see below).

 

Step 1

The first step takes the message input parameter and saves the AS2 message to a file with the help of the as-file function. The Target parameter computes the following expression:

 

{substring(current-message-id(), 1, -1))}.msg

 

This expression returns a substring from the AS2 message, by extracting the Message-ID header field of this message, returning characters starting with character position 1, and trimming the last character. This substring is a Message Disposition Notification (MDN) that provides the ID of and status information about the original message. The MDN is copied to the working directory (C:\as2\incoming).

 

Step 2

The second step extracts the name of the AS2 partner from the partner input parameter with the help of the as2-partner-remote-name function. The result of this step is a string called sending_partner that will be used in the email subject in the last step.

 

Step 3

The third step sends a notification about a new AS2 message received from the sending partner. The message body provides information about the MDN. You might want to send such a notification to your own email address, your colleagues, or the administrator, for example.

fs_as2_remote_partner_example

 

© 2017-2023 Altova GmbH