Trading Networks 10.11 | Administering Trading Networks | Preparing for Document Delivery | Enabling Document Delivery Using a Web Service
 
Enabling Document Delivery Using a Web Service
To deliver a document to a partner using a Web service (that is, by invoking a Web service at the partner's end), you create a Web service delivery method. Trading Networks uses the Web services feature provided by Integration Server to deliver documents using a Web service.
Trading Networks uses a Web service connector to invoke the Web service at the partner's end. To pass the data from Trading Networks to the Web service connector based on the connector's input data structure, you create a mapping service. The mapping service maps the pipeline variables to the required input values of the Web service connector. The output of the service must have the same document structure as that of the Web service connector's input document structure. In most cases, the input of the mapping service is the BizDocEnvelope, so the mapping maps the bizdoc attributes to the input parameters of the Web service connector.
After the Web service connector invokes the Web service at the partner's end, it obtains the response from the partner. The response obtained can be added to the bizdoc or sent as a separate document to Trading Networks. If Trading Networks receives the response as a separate document, it processes that document just like any other document it receives.
The following diagram illustrates delivery using a Web service delivery method.
Create a Web service connector for every Web service you want to invoke. Using Software AG Designer, create a consumer Web service descriptor from the remote Web service. For instructions, see the Web Services Developer’s Guide. Integration Server automatically creates the Web service connector from the descriptor.
Create a mapping service that describes how to pass the data from Trading Networks to the Web service connector. Create a Java service or a flow service whose output has the same document structure as the Web service connector's input document. Map the pipeline variables with the required input values of the Web service connector. In most cases, you might want to map the bizdoc attributes with the relevant input parameters of the Web service connector. In such cases, the input for the mapping service is the BizDocEnvelope.
You will create the Web service delivery method by providing the Web service connector and mapping service details in the receiving partner’s profile (see Adding an Immediate Delivery Method to a Profile). You can add the Web service response to the bizdoc, or you can create a document out of the response. If you want to create a document, define a document type for the document so that Trading Networks recognizes the document, and define a processing rule for that document type.