Bidirectional Translation Web Services are now available in B2B 11g PS5 Release
By Shub Lahiri, A-Team on Apr 30, 2012
In the past, we had received requests from various parties to provide web service based translation capabilities within B2B 11g for going from an XML payload to native one or vice versa. Starting from SOA Suite PS5, this feature is available within the base install. The note here describes the basic usage details, which can then be extended to embed in any other SOA application.
XML To Native
The WSDL definition and the basic test page are available in any basic SOA install at the following URLs:
- WSDL: http://<Host>:<Port>/b2b/services/XMLToNativeServiceAsString?wsdl
- Test Page: http://<Host>:<Port>/b2b/services/XMLToNativeServiceAsString
Transaction Set Only
The test page fields that need to be populated are fairly self-explanatory. The screen shot below shows the input values provided, for the document used in the standard sample demo for handling 850 EDI (PO) over AS2.
- transactionSetOnly: true - This flag defines if the payload will be just the base transaction fields and exclude the envelope or header properties for the exchange.
- documentTypeName: 850 - This document definition has to exist in the B2B repository as a pre-requisite.
- documentTypeVersion: 4010 - The version corresponding to the document type specified earlier
- payload - The sample XML payload, which typically is passed from a backend application for translation.
The response obtained after invoking the web service with the above-mentioned values is shown below.
As seen in the above screen shot, the translated native EDI payload is returned within the response.
Transaction Set and Envelope Segment
As an extension to the XML to native example shown earlier, the envelope segments can also be generated by changing 2 input fields, namely,
- transactionSetOnly: false
- tpName: Remote Trading Partner Name or ID. The assumption here is that a valid, deployed agreement should exist in the repository for the document type, version and the trading partner.
- XML Payload: Appropriate fields for envelope segments should be specified within the Internal Properties section.
The response, as mentioned earlier, now includes the envelope segments for the native EDI.
Native to XML
The reverse translation is also possible by calling a different web service as shown below.
- WSDL: http://<Host>:<Port>/b2b/services/NativeToXMLServiceAsString?wsdl
- Test Page: http://<Host>:<Port>/b2b/services/NativeToXMLServiceAsString
Transaction Set OnlyWe specify similar parameters here, namely,
- transactionSetOnly: true
- documentTypeName: 850
- documentProtocolVersion: 4010
- payload: EDI payload for only the transaction, without the envelope segments
The response obtained in this case will be the corresponding XML payload for the EDI.
It should be noted that the envelope segments cannot be translated for the native to XML web service.
To get more details, please refer to this link within the SOA Suite Documentation set.