Handling the Server Side of a B2B XML Transaction

LANSA

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

In example 214 Handling the Client Side of a B2B XML Transaction the client side of an XML based ordering transaction is demonstrated by using the standard www.lansa.com server to handle the server side of the transaction:



This example demonstrates how the server side of this transaction might be implemented.

It does this by reusing the example 214 client side of the transaction, but in such a way that it switches to execute function SET216S to handle the server side of the transaction (circled in red):

The main SET component in this example is function SET216S.




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 1SET216S asks the JSM to load the HTTPCLIENT service.
Step 2SET216S asks the JSM to read the incoming order details (in XML format) and transform them into an RDML working list.
Step 3SET216S asks the JSM to write a XML formatted order confirmation back to the sender.
Step 4SET216S asks the JSM to unload the HTTPCLIENT service

At execution time functions SET214G and/or SET214W from example 214 are reused so that new order details can be input via a green screen or via a web form. This is very simple to do. Instead of sending their order details to www.lansa.com they send them instead to the server where SET216S is installed:



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



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

RECEIVE HANDLER(IXML) XSL(set216_order_request_in) 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 SET216S for exact details of each command keyword and how they are used to control the JSM.



In this step function SET216S assembles and executes a JSM command to SEND the XML to the transaction server.

The JSM command used looks like this:

SEND HANDLER(IXML) XSL(SET216_ORDER_RESPONSE_OUT) 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
Keywords
Example 216JSM
LANSA IntegratorWeb Service
InternetXML
B2BXSL