Handling the Client Side of a B2B XML Transaction

LANSA

Handling the Client Side of a B2B XML Transaction
Example 214 - Rating: advanced
The Things that Make Up this ExampleTo Execute this Example

This example demonstrates how the JSM (Java Service Manager) might be used to handle an XML based B2B transaction between two different organizations.

Typically the processing of a transaction by an organization involves the permanent storage of information and the initiation of a business process (eg: placing an order, buying a book, insuring your car, etc). Often confirmation details are given to the transaction initiator so that they can use these later to track the status of their transaction (eg: order numbers, confirmation numbers, receipt numbers, etc).

In this example an order is assembled on a transaction client and then sent to a transaction server for processing. The transaction server then confirms placement of the order:



This example focuses specifically on how the transaction client is designed and constructed.

The transaction server is provided by www.lansa.com in this example. For details of how the transaction server might be designed and constructed refer to example 216.

Structurally the main SET components in this example interact like this:



where:
SET214GCollects the order details from a 5250 “Green Screen” and passes them on to SET214R for processing.
SET214WCollects the orders details from a Web browser interface and passes them on to SET214R for processing.
SET214RHandles the order processing and interfaces to the JSM.



Placing an Order

SET214W allows you to place an order from the Internet like this:



Likewise, SET214G allows you to place an order from a 5250 Green screen device:




Detailed Notes and Suggestions

The major part of this example is the interactions between function SET214R and the JSM. There are 4 major interactions between function SET214R and the JSM:



where:
Step 1SET214R asks the JSM to load the HTTPCLIENT service
Step 2SET214R asks the JSM to transform the order details (provided to it in an RDML working list) into XML format and sent them out across the internet to the XML transaction server
Step 3SET214R asks the JSM to read the XML formatted response from the XML transaction server and transform them back into an RDML working list.
Step 4SET214R asks the JSM to unload the HTTPCLIENT service

Steps 2 and 3 are the most interesting because they involve transformations into and out of XML.



In this step function SET214R assembles and executes a JSM command. The JSM command used looks like this:

SEND HANDLER(OXML) XSL(set214_order_request_out) HOST(xxxx) URI(yyyy) SERVICE_LIST(S_214PROD,S_214QTY)

When executed by the JSM it causes an RDML working list to be transformed into XML. The resulting XML is then sent to the transaction server:

See the source of function SET214R for exact details of each command keyword and how they are used to control the JSM.



In this step function SET214R assembles and executes a JSM command to RECEIVE and transform the XML from the transaction server. The JSM command used looks like this:

RECEIVE HANDLER(IXML) XSL(SET214_ORDER_RESPONSE_IN) SERVICE_LIST(S_214ERRO)

When executed by the JSM it causes the incoming XML to be transformed and the information parsed into the function.





This Example Also Demonstrates:
  • Batch Programming
  • Exchanging lists between an interactive and batch job using SAVE/RESTORE LIST
Keywords
Example 214JSM
LANSA IntegratorWeb Service
InternetXML
B2BXSL