Send test AS2 message to SAP PO via POSTMAN application
Imagine you have developed an integration flow in SAP PO and when you move forward to do unit testing in development environment, you got to know that the sender system is not able to send messages to development environment (Sometimes Banks can’t send messages to development environment) as well as you are not authorized enough to use SAP PO test tool. In that case we try to mimic sender systems and send the messages on our own using different tools depending upon the sender adapter which we have used in our integration.
I will try to explain how we can use POSTMAN tool to send AS2 messages to SAP PO. Generally, developers use “mendelson as2” tool to send AS2 messages which is good and far better than the method I will explain below but see there are some issues with mendelson as2 tool as well. Main issue is its availability. Free open source version of mendelson tool is available only on sourceforge website and in some client network you are not allowed to download software from there. So let me show you how to send simple test message using POSTMAN tool which we generally use to test REST/API based integration flows.
We need to know how AS2 messages were passed over HTTP. You can refer RFC 4130 for better understanding of AS2 protocol and how they can be transmitted over HTTP. So follow below steps to send AS2 messages to SAP PO using POSTMAN tool.
- First we need to find out the URL to which we are going to send AS2 message. It should be http://<host>:<port>/AS2/<PATH>. Here PATH can be replaced by the Expected URL path value you have mentioned in the AS2 sender channel.
- Then in POSTMAN tool configure the headers like the below snapshot.
- Then you can also choose body as per your requirement. You can send EDI messages as files or raw XML.
Raw XML BodyFile body
- Fill in all the fields as per your requirements then press send and you will able to send test AS2 messages to SAP PO system.
For this above method, I have used encrypted EDI message so you need to remove decryption and signature validation from your sender channel. It’s just a simple example to show you that simple tools are also very powerful if you know the underlying protocols correctly. You can try to implement same for encrypted messages as well. You can also implement similar method to send AS2 messages from SAP CPI using HTTP adapter as well (Just kidding SAP CPI has it’s own AS2 adapter).
Every problem comes with a solution so just keep searching for that.