Overview: Receiving AS2 Data
The diagram below illustrates the high-level process of receiving messages with FlowForce Server Advanced Edition.
Receiving AS2 data with FlowForce Server
The process illustrated above works as follows:
1. Configure AS2 partner and certificates
To set up the communication with AS2 partners, you will need to obtain their AS2 connectivity details (such as URI and AS2 name), and exchange certificates. The certificates must be imported (and partner details must be entered) into FlowForce Server, see Configuring AS2 Certificates and Configuring AS2 Partners.
2. Create a job
A FlowForce job must be created in order to expose the AS2 service where FlowForce will listen for AS2 requests.
3. Partner sends AS2 data
Once you've shared the URL of the service with your partners, they can start sending AS2 requests to it.
4. Process incoming AS2 data
Upon receiving the AS2 message, FlowForce attempts to decrypt and validate it. If this fails, FlowForce sends an error MDN before starting the job.
Otherwise, the incoming data is processed by the job that exposes the AS2 service. You can configure the job to process data according to your needs (for example, convert the message from stream to string, read specific headers from the message, save data to a file with a custom name, get the name of the sending partner, and so on).
According to AS2 specification, the MDN should concern only the delivery of the message, not the content of the message. For this reason, the AS2 receiving job must be as minimal as possible (typically, saving the message to a file or a database).
The AS2 receiving job should never fail because of reasons related to the content of the message. Therefore, any extra steps (other than accepting the message and saving it) must be defined as separate jobs. Otherwise, if the receiving job contains a step not related to message delivery and that step fails, this will lead to a failure (negative) MDN in turn, which is not expected to happen according to the AS2 specification.
5. Reply with synchronous MDN
After FlowForce Server finished processing the job, it sends back a synchronous MDN to report either success or failure based on job execution result.
For more information about configuring FlowForce as an AS2 server, see Receiving AS2 Messages.