Ariba Supplier OnRamp 7.1 | webMethods Ariba Supplier OnRamp Documentation | webMethods Ariba Supplier OnRamp Installation and User’s Documentation | Concepts | cXML Document Processing with Trading Networks
 
cXML Document Processing with Trading Networks
Instead of using the built-in document processing mechanism of Ariba Supplier OnRamp, you can use the more powerful document-routing and processing engine built into Trading Networks. Using this engine, you can selectively process documents based on processing rules that you define.
Ariba Supplier OnRamp provides a rules utility that you can use to:
*Create Trading Networks processing rules specific to cXML.
Ariba Supplier OnRamp generates simple Trading Networks processing rules that route cXML documents to the appropriate processing services, based on document type (PunchOutSetupRequest, OrderRequest, ProfileRequest, MasterAgreementRequest, and InvoiceDetailRequest). You expand what Ariba Supplier OnRamp creates by modifying the processing rules to implement more specific routing rules, using the Trading Networks Console.
*Create Trading Networks handler service stubs that are invoked by the processing rules.
These stubs create cXML responses that are returned to Ariba SN, based on the outcome of your handler implementation. The service handler stubs also execute logging/event services in Ariba Supplier OnRamp. You expand on what Ariba Supplier OnRamp creates by implementing the handler code to process the cXML request.
You can define multiple handlers for each document type operation. For example, you can define multiple handlers to process new OrderRequest documents, which are selectively invoked based on criteria you specify. In contrast, Ariba Supplier OnRamp only allows you to define one handler for each document type operation.
The figure illustrates how a cXML document is processed by Ariba Supplier OnRamp using Trading Networks (WmTN), and how responses are returned to the Ariba Buyer.
1. The receiveCXML service receives a cXML message and creates a node object, as described in The Document Receiver Service: receiveCXML. If the message is a Multipart MIME message with an attachment, receiveCXML also creates an attachmentWrapperCollection object.
2. The receiveCXML service invokes the Trading Networks document receiver service wm.tn:receive, passing both the node object and the attachmentWrapperCollection object (if present) in the pipeline.
3. Trading Networks does nothing with the attachmentWrapperCollection (if present).
Trading Networks decodes the node object, identifies the cXML document type, and extracts attributes about that document, predefined by Ariba Supplier OnRamp cXML document type definitions that it creates.
Trading Networks stores the document, creates a bizdoc document envelope, and retrieves sender and receiver profile information about this document.
Trading Networks then looks up cXML processing rules you define using Ariba Supplier OnRamp rules utility.
Upon finding a processing rule, Trading Networks invokes the TN handler service that was automatically created and assigned to the processing rule by Ariba Supplier OnRamp rules utility.
a. The bizdoc document envelope, sender/receiver profile information is sent to the TN handler processing service (4a in previous figure).
b. Also, if the attachmentWrapperCollection object is present, it is automatically passed to the handler service (using the pipeline.) The attachmentWrapperCollection will only be present if the document was an OrderRequest sent with attachments (4b in previous figure).
4. If logging is enabled, the TN Handler service invokes logging services to log the request that was received.
If the specified setupRequestReceived event handler service is specified for the particular request event, Ariba Supplier OnRamp invokes the event services you defined.
5. In addition, if a Shared Secret is specified in Ariba Supplier OnRamp, the PunchOutSetupRequest is checked to see if it contains the same Shared Secret. If not, processing of the request ends and the error is logged.
6. Next, the code that you implemented to process the cXML request is executed.
*For PunchOutSetupRequests, your code must output a catalogURL string parameter or a serviceError record, if an error occurred.
*For OrderRequests, your code must output a serviceError record if an error occurred.
Control then returns to some predefined post-processing code that performs additional logging of the request and invokes the appropriate event handler services, if configured.
Finally, a string field, cXMLResponse, is created containing the cXML Response and is passed back to Trading Networks.
7. Trading Networks returns the cXML response to Ariba SN in an HTTP response predefined in the routing rule created by Ariba Supplier OnRamp rules utility.