Bidirectional Translation Web Services are now available in B2B 11g PS5 Release

Introduction

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 a native one and vice versa. Starting with SOA Suite PS5, this feature is available in the base install. The note here describes the basic usage details, which can then be extended to embed in any other SOA application.

Main Article

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.

b2bws_xmltonative1

 

The response obtained after invoking the web service with the above-mentioned values is shown below.

b2bws_xmltonative2

 

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 just shown, 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.

b2bws_xmltonative3

 

The response, as mentioned earlier, now includes the envelope segments for the native EDI.

b2bws_xmltonative4

 

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 Only

We specify similar parameters here, namely,

  • transactionSetOnly: true
  • documentTypeName: 850
  • documentProtocolVersion: 4010
  • payload: EDI payload for only the transaction, without the envelope segments

b2bws_nativetoxml1

 

The response obtained in this case will be the corresponding XML payload for the EDI.

b2bws_nativetoxml2

 

It should be noted that the envelope segments cannot be translated for the native to XML web service.

Further Reading

To get more details, please refer to this link within the SOA Suite Documentation set.

Add Your Comment