Handling the Client Side of a B2B XML Multiple Status Query

LANSA

Handling the Client Side of a B2B XML Multiple Status Query
Example 215 - 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 multiple status query.

Status queries are very common B2B interactions. Queries such as “Where is my Package?” through to “What price can I buy a widget for?” are examples of status queries. Typically status queries allow you to provide a list of the things that are to be queried.

In this example the query is “What is the status of my order(s)?”. A list of order numbers is assembled on a query client. The list is then sent to a query server. The query server then sends back the status of each order.



This example focuses specifically on how the query client is designed and constructed. The query server is provided by www.lansa.com in this example. For details of how the query server might be designed and constructed for this example please refer to example 217.

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



where:
SET215GCollects the list of order numbers from a 5250 “Green Screen” and passes them on to SET215R for processing. The resulting order status details are then displayed.
SET215WCollects the list of order numbers from a 5250 “Green Screen” and passes them on to SET215R for processing. The resulting order status details are then displayed.
SET215RHandles the order status processing and interfaces to the JSM.




Requesting the Status of an Order

SET215W allows you to query an order’s status from the Internet like this:



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


Detailed Notes and Suggestions

The major part of this example is the interaction between function SET215R and the JSM.

There are 4 major interactions between function SET215R and the JSM:


Step 1SET215R asks the JSM to load the HTTPCLIENT service
Step 2SET215R asks the JSM to transform the list of order numbers (provided to it in an RDML working list) into XML format and sent them out across the internet to the XML query server
Step 3SET215R asks the JSM to read the XML formatted response from the XML query server and transform it back into an RDML working list.
Step 4SET215R 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 SET215R assembles and executes a JSM command.

The JSM command used looks like this:

SEND HANDLER(OXML) XSL(set215_orderstatus_request_out) HOST(xxxx) URI(yyyy) SERVICE_LIST(S_214ORDN)

When executed by the JSM it causes an RDML working list to be transformed into XML

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



In this step function SET215R assembles and executes a JSM command to RECEIVE and transform the XML from the query server.

The JSM command used looks like this:

RECEIVE HANDLER(IXML) XSL(set215_orderstatus_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.



Keywords
Example 215JSM
LANSA IntegratorWeb Service
InternetXML
B2B