This example illustrates how to configure a complete AS2 message exchange between two AS2 partners, from a FlowForce Server perspective. In this example, both the sending AS2 partner and the receiving AS2 partner are FlowForce Server instances.
• The sending server (Hermes) must successfully send an AS2 message to the receiving AS2 server (Apollo).
• The receiving server (Apollo) must successfully process the incoming message and store it locally.
As illustrated above, the AS2 partner's name used for AS2 communication is "Apollo", while the partner object name stored in FlowForce Server is "APOLLO". The "Request URL" value assumes that the partner's host name is also apollo. If the host name is different, adjust the URL accordingly. We will configure the actual AS2 service behind this URL in a subsequent step.
2. Create a new job that sends an AS2 message.
a) Open to the public container, and click Create | Create job.
Enter a job name (for example, "send-as2"), and, optionally, a description.
b) Click New filesystem trigger and set the trigger settings as shown below. If the directory /home/altova/as2/outgoing does not exist on Hermes machine, create it.
As soon as you add the trigger, a parameter called triggerfile is added to the job. This parameter represents the file name that will trigger this job automatically, whenever you copy a file to /home/altova/as2/outgoing. For more information, see File System Triggers.
c) Add an execution step that sends an EDI file from the local path defined previously to the AS2 partner. For more information about what this step does, see Sending AS2 Messages.
d) Finally, add the credentials of the user account on the local machine (typically, the username and password that you use to log on to this machine). Note that these credentials are not the same as the username and password to the FlowForce Web administration interface. For more information, see How Credentials Work.
e) Click Save. The job should now appear under "Active Triggers" in the FlowForce Server home page.
2. Make sure that FlowForce Server is allowed to communicate through the operating system's firewall. In this example, since the "Apollo" FlowForce Server runs on Windows, it must be allowed to communicate through Windows Defender Firewall.
3. Create a new FlowForce Server container; let's call it "as2service". (In FlowForce, permissions are set at container level, so it is advisable that you create a separate container for the job that will receive AS2 messages. This way, you will be able to set AS2-specific permissions only to the required container, without affecting the permissions applicable to other existing FlowForce jobs).
4. Open the "as2service" container defined previously and create the sending partner, Hermes, as shown below. The "Request URL" value assumes that the partner's host name is also hermes. If the host name is different, adjust the URL accordingly.
5. Open the "as2service" container defined previously and create a new job. The purpose of this job is to expose an AS2 service that listens to AS2 requests. When a new AS2 message is received, this job will copy it to a temporary folder.
a) Select the Make this job available via HTTP at... check box and give a name to the AS2 service (in this example, "as2-receiver").
b) As illustrated above, select the option AS2 service from the drop-down list. As a result, two input parameters are added to the job, partner and message. These can be used to process and store information about the sending partner and the message, respectively. In this example, we will store the message only, as shown in a subsequent step.
c) Add an execution step that copies the received message to a local path. The FlowForce Server expressions used below essentially convert the message to a file, and compose the file name based on the Message-ID header field. For a more detailed explanation about these expressions, see Receiving AS2 Messages.
Make sure that the directory C:\as2\incoming exists. This is the directory where received AS2 communications will be saved.
6. Go to the container public / as2service, and click Permissions. Click Add Permissions and assign the permission "Service: Use" to user anonymous on the "as2service" container.
This effectively makes the AS2 service public and enables anyone to access and consume it, without authentication.
On Hermes machine, copy an .edi file to the directory configured previously, /home/altova/as2/outgoing. When the directory polling interval elapses (60 seconds, by default), the trigger is executed, and the job sends the file to the AS2 service on Apollo machine.
• The "Interoperability Settings" parameters are misconfigured for Hermes partner on Apollo machine.
On success, the receiving job on Apollo machine processes the incoming message and creates a new file at the following path: C:\as2\incoming.