Version: 17.07
Supported Since: 17.01
Hogwarts is one of the best Universities in Great Britain. For the selected students they provide scholarships to support financially for the educational purposes. They have partnerships with many popular organizations to support this effort such as Gringotts bank, Hogsmead cafe and Ollivanders shopping complex. The students are allowed to buy required items from these partner organizations under the name of university. At the end of each month these organizations will compose invoices and send them over to Hogwarts. Hogwarts already have some backend applications to process the receiving invoices and generate a aggregated invoice to be sent out to Gringotts bank.As the information included in these invoices are confidential to the students and the university don’t want see them in wrong hands. Therefore to enforce the security and reliability university has discussed with their business partners and agreed upon establishing a secure and reliable trading system over the AS2 protocol. To provide the AS2 communication support Hogwarts has chose the AdroitLogic UltraESB-X as the trusted solution.
Hogwarts has designed the solution in a way that the integration point for the ESB and the backend system will be a shared file system. The ESB will persist the receiving invoices over AS2 to a predeclared directory for the backend processing application to pick up. After processing and generating the aggregated invoice the backend application will persist it into a different predeclared directory in the shared file system. ESB is expected to pick the invoice file from that directory and send it over to the bank over AS2.
UltraStudio Configuration
UltraESB-X Configuration
In-order to develop the above mentioned flow, first you need to add AS2, File, Email from connector list and AS2, Attachment dependency from processors list. TIP: If you have already created a project, you can add above dependencies via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list and Processors list, select above dependencies
After that, in the project.xpml file select the AS2 Trading template and fill the necessary fields. After that following resources will be added to the project.xpml file
For the complete system to work there are two major message flows required. 1. Message flow to receive invoices over AS2 and send out MDNs 2. Message flow to send out invoices over AS2 and receive MDNs
In-order to develop the AS2 message receipt flow, first let’s create an integration flow named “as2-inbound-integration” and follow the below steps
Add a AS2 Gateway Ingress Connector to obtain the request messages in via As2 from the partner organizations. For the AS2 Gateway Configuration select AS2-Resource.
Insert an Attachment Saver element to persist the incoming message to the file system. Use the pattern .*
As some trading partners request synchronous MDNs while some others request asynchronous MDNs it is required to insert a MDN Option Evaluator element as the next element of the flow. The Async MDN requested outport of the element should direct the message to the async MDN sending element while the sync MDN sending element should invoke the AS2 Message receiving element to invoke sending the sync MDN with response.
To send out asynchronous MDNs it is required to add an AS2 Async MDN Sender as the final element of the message inbound flow.
The complete flow will look like below.
In-order to develop the AS2 message sending flow, first let’s create an integration flow named “as2-outbound-integration” and follow the below steps
Add a File Ingress Connector element to pick invoices from the shared file system and inject them into the ESB
The AS2 message sending element expect the AS2 identifiers of the message sending station and the message receiving partner as transport headers of the message. For that lets add two Add Transport Header elements next.
Next add a AS2 Gateway Sender element to send out the AS2 Message.
Finally that add a Success flow end element to successfully complete the flow
The complete message outbound flow should look as below
Now after running the project, place some test invoice files inside the outbound directory to send out to test the flow.