Handling the Server Side of a B2B XML Transaction
Example 216 - Rating: advanced
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:
![](0000007f.gif)
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):![](00000080.gif)
The main SET component in this example is function SET216S.
![](00000081.gif)
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:
![](00000082.gif)
Steps 2 and 3 are the most interesting because they involve transformations into and out of XML.
![](00000083.gif)
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:
![](00000084.gif)
See the source of function SET216S for exact details of each command keyword and how they are used to control the JSM.
![](00000085.gif)
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.
![](00000086.gif)
This Example Also Demonstrates:
Example 216 - Rating: advanced
The Things that Make Up this Example | To 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:
![](0000007f.gif)
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):
![](00000080.gif)
The main SET component in this example is function SET216S.
![](00000081.gif)
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 1 | SET216S asks the JSM to load the HTTPCLIENT service. |
Step 2 | SET216S asks the JSM to read the incoming order details (in XML format) and transform them into an RDML working list. |
Step 3 | SET216S asks the JSM to write a XML formatted order confirmation back to the sender. |
Step 4 | SET216S 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:
![](00000082.gif)
Steps 2 and 3 are the most interesting because they involve transformations into and out of XML.
![](00000083.gif)
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:
![](00000084.gif)
See the source of function SET216S for exact details of each command keyword and how they are used to control the JSM.
![](00000085.gif)
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.
![](00000086.gif)
This Example Also Demonstrates:
- Batch Programming
Example 216 | JSM |
LANSA Integrator | Web Service |
Internet | XML |
B2B | XSL |