What is B2B Gateway?
B2B stands for Business to Business Gateways. Companies interact and collaborate with each other for their business needs. To do so, they use messaging in the form of XML/cXML/EDI.
B2B Gateway is a communication layer between two trading partners and is always a two-way communication medium. It communicates messages within protected networks that use encryption/decryption technology while carrying the messages.
The B2B technology is widely used in supply chain and marketing domains among others.
Today’s article is a brief discussion on testing the B2B communication messaging system.
What You Will Learn:
Software tools like INOVIS, Babelway, e-Insight, Beacon EDI, etc. are few EDI (Electronic Data Interchange) tools used by companies to accomplish B2B solutions. Many domains like finance, marketing, sales, eCommerce, automobile, logistics and manufacturing use this technique for data exchange.
Let’s look at an example.
Automobile companies manufacture vehicles and order parts like glass, tires, seat covers, electrical parts, fiber parts, aluminum parts, etc. from 3rd party vendors. To do this, the automobile company will send the list of parts in the form of messages (XML/cXML/EDI format) to the 3rd party vendor.
While transmitting the messages from one end to the other, the B2B Gateway will facilitate the transportation of the messages in a secure and reliable environment.
Also read => What is Integration Testing?
This section will deal with how exactly the messages in the B2B Gateway are being carried.
This is a simple example to explain how the business transactions between Company-A and Company-B is carried out.
Let’s assume there are two companies Company-A and Company-B. Company-A’s last layer of the application is PMAPL and the Company-B’s last layer is VAPL. The Company-A is the parent company who manufactures the automobile as a finished product. To order the raw materials the Company-A will contact the Company-B, the vendor who supplies the raw materials.
Now, once the business agreement completes between the two companies they start trading by communicating with each other. The Company-A will place an order with the help of internal application (or applications) and it flows through the system up until it reaches PMAPL application. The PMAPL application will prepare the final message (XML) to be sent to the vendor.
(Note: Click on the image for an enlarged view)
The PMAPL application is the boundary layer for Company-A. Once the message passes from the PMAPL application, it will first reach the B2B Gateway application. The message received at the B2B Gateway should translate to a B2B gateway understandable format, which means the XML message structure/elements sent by the PMAPL application will change once the B2B Gateway receives the message.
The B2B gateway will interpret the message into its own desired structure.
The B2B Gateway then starts processing the message and if need be, it could encrypt the message. Once the encryption is done the B2B Gateway will transmit the message to the VAPL application at Company-B. Before receiving the message at VAPL application in Company-B, the B2B Gateway will decrypt the message to the XML format.
Now the B2B Gateway will transform the message into the vendor application’s preferred format. The vendor may also check the message for security and correctness of the message received.
Once all that is done, the vendor will accept the message and send an acknowledgment to PMAPL of Company-A. If any discrepancy is found, the vendor may reject the transaction with a failure message as a reply.
The other technology involved in the transaction is the firewall that protects/restricts the unauthorized messaging. That’s why companies employ ERP Firewall solutions to examine all inbound and outbound message authentication. The Firewall will block all the unnecessary messages or documents that are not as per the rules or configuration.
One more thing in B2B messaging is that it maintains EDI standards to communicate messages among the trading partners. The EDI standards help companies maintain the integrity of transmitting messages. You can go through the EDI standards in the web to get more information on it.
The testing B2B messaging system for any application is a very critical feature – all messages should be checked for correctness, completeness, format and security, especially when testing starts at the vendor end.
Before starting testing, go through the message/data flow architecture of the system.
This includes understanding:
You can usually find this information from the SA/BA/Design document. Make sure XML to XML mapping and XSD documents are fixed before you start testing.
Let’s take the example described above and here are the steps to test it.
Application PMAPL is generating the outgoing xml message1.
First, validate the xml message1 vs the input data with respect to mapping document and ensure the correctness of data values. Also validate the xml header, metadata, elements (with respect to XSD provided by SA).
Now once the xml message1 is validated, then the PMAPL application will process the xml message1 and send it to the B2B Gateway application. Here the transformation happens and the new xml message2 is received at B2B Gateway application.
Extract the xml message from the B2B Gateway application.
Here you will find that the values of the xml are same, but the xml header, metadata and some of the element name might be changed. This is because the message is meant to be in B2B Gateway preferred format.
Now start validating the xml message2 vs the xml message1 with respect to the mapping document and ensure the correctness of data values.
Sometimes the element datatype could also be changed, and while validating you will have to consider the scenario accordingly.
Also, you need to validate the xml header, metadata, elements (with respect to XSD provided by SA).
Tip: The easy way to validate the xml message is with the help of excel, you can drag and drop the xml message to excel sheets and compare the values for correctness and completeness.
The next level of transformation that happens is the encryption of the xml message2. This is done by the B2B Gateway application before it transmits the message to the vendor. (This encryption/decryption of the message is sometimes mandatory and sometimes not. It depends on the agreement between the trading partners on how to maintain the message format and data security.)
Once the encryption of xml message2 is done, the B2B Gateway transmits the xml message3 to the receiving end of the B2B gateway at the vendor site.
B2B Gateway application will confirm that the xml message3 has been received at the vendor end.
Challenge: The tester might be restricted from this point beyond that the vendor site might be restricted for testing. In that case, we have wait for the positive or negative response to the message from the vendor. However, if the tester is working at the vendor site, then the tester has to perform similar steps as mentioned above.
Now the xml message3 will be decrypted by the B2B Gateway application and it would generate the xml message4. Then the VAPL application will transform the xml message4 to VAPL desired format to xml message5 for further processing.
Then VAPL application will confirm with a positive/negative acknowledgment message back to PMAPL application through B2B Gateway application. Again the communication process is same as above procedure but in a reverse way.
Let’s discuss some failure scenarios that we might encounter while testing, in the same above example.
We hope this article has presented an example based discussion on B2B, its testing techniques, and challenges. The B2B testing needs multi-level application support to be successful and involves well-coordinated team effort to drive it to fruition.
About the Author: This is a guest article by Asish K Mallik having 7+ years of ERP system testing experience.
Please share your comments, questions, and experiences with us below.