An e-Retail request-response scenario has been implemented using
two
message flows and a message set. These message flows are
Client Message Flow and WebServices Message flow.
These two message flows works in the following way :
The Client Message Flow and WebService Message Flow usages JMSInput
and
JMSOutput nodes as a JMS consumer and producer respectively to an
external JMS provider.
The sample uses WebSphere MQ as the JMS provider.
There are two message flows in this sample. The retail client
application (Web application) sends the SOAP request message to the
RETAIL_Client message flow. The SOAP request message contains Item ID
for which the user wants detail description. Here the SOAP request
message is captured in the message flow enqueue file, which will be
used as an input message.
RETAIL_CLIENT flow is acting as JMS Client and sends the SOAP request
message to JMS destination queue.
The RETAIL_WEBSERVICE message flow is simulates a web service.
RETAIL_WEBSERVICE message flow retrieves the SOAP request message from
the JMS Destination queue. It connects to the backend database and gets
the item details from the database. Then it creates SOAP reply message
and sends it back to the JMS Reply to Queue. The Compute nodes in
RETAIL_WEBSERVICES
message flow contain detailed ESQL comments explaining exactly what has
been done.
RETAIL_CLIENT flow which is waiting at ReplyToQueue gets the SOAP
Reply message and sends it to the client application.
This flow is present in Flows-->"client" folder of the RetailMsgFlowProject and represents a JMS Client.
SOAP request message is put on the MQInput Queue "RETAIL_REQ" of
RETAIL_CLIENT message flow using message.enqueue file. When the message
is passed
through the flow, it is converted the MQ input message into a JMS
message using MQJMSTransform
Node and sends the request message into JMS
destination Queue "RETAIL_SRV_REQ" and set the Reply to Destination
Queue as "RETAIL_CLI_REP".
The JMS client waits for the SOAP Reply message at "RETAIL_CLI_REP".
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:c="http://www.retailShop.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<c:RetailIN>
<ItemID>ID101</ItemID>
<Description></Description>
<TechDescription></TechDescription>
<Associaries></Associaries>
<Availability></Availability>
<Price></Price>
</c:RetailIN>
</soapenv:Body>
</soapenv:Envelope>
The message is then turned into a producer message, and is put on a
queue "RETAIL_SRV_REQ" for the RETAIL_WEBSERVICE flow to pick it up.
The test message used to drive the sample is a SOAP request Message
for ItemID "ID102" requested by an e-Retail Client Application :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:c="http://www.retailShop.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<c:RetailIN>
<ItemID>ID102</ItemID>
<Description></Description>
<TechDescription></TechDescription>
<Associaries></Associaries>
<Availability></Availability>
<Price></Price>
</c:RetailIN>
</soapenv:Body>
</soapenv:Envelope>