Receiving, Dispatching, and Sending JMS Messages
The procedure in this section describes how to set up your system to receive inbound messages from JMS, perform an action within the Siebel application based upon the message, and send a synchronous response back to the external system.
To receive, dispatch, and send messages using EAI JMS Transport
Set up a JMS queue to receive messages from the Siebel application and give the queue an easy to identify name, such as fromSiebel.
Refer to your JMS provider documentation on how to administer, monitor, and define new persistent queues.
Set up a JMS queue to send messages to the Siebel application.
Refer to your JMS provider documentation on how to administer, monitor and define new persistent queues.
Give the queue an easy-to-identify name such as toSiebel.
Create a message in the queue.
Note: To test this scenario adequately, you must have a partner application that can place a valid message for the Siebel application into the queue.Set up a workflow in Siebel Tools to process the incoming XML request. The workflow should contain the following steps, as shown in the following image:
EAI XML Convert (XMLDocToIntObjHier): Receives an incoming XML document and converts it to an integration object.
Siebel Order ASI (QueryByExample): Executes a query using Siebel Order application service.
EAI XML Converter (IntObjHierToXMLDoc): Converts the response to an XML document.
Note: For details on the Business Process Designer, see Siebel Business Process Framework: Workflow Guide.Create the following process properties:
Name Data Type In/Out Default String Comments <Value>
Binary
In/Out
<Value>
Order Integration Object
Order Message
Hierarchy
In/Out
Not applicable
XML representation of the integration object
Set up the first step of the workflow, after Start, to use the EAI XML Converter with the XMLDocToIntObjHier method.
This step converts the incoming XML document to an integration object representation using the following input and output arguments:
Input Argument Type Property Name <Value>
Process Property
<Value>
Property Name Type Output Argument Order Message
Output Argument
SiebelMessage
Set up the second step to use the Siebel Order ASI with the QueryByExample method.
This step queries the Order business object based upon the provided XML document using the following input and output arguments:
Input Argument Type Property Name SiebelMessage
Process Property
Order Message
Property Name Type Output Argument Order Message
Output Argument
SiebelMessage
Set up the third step to use the EAI XML Converter with the IntObjHierToXMLDoc method.
This step converts the integration object to a well-formed XML document using the following input and output arguments:
Input Argument Type Property Name SiebelMessage
Process Property
Order Message
Property Name Type Output Argument <Value>
Output Argument
<Value>
Save and deploy the workflow.
For details on deploying workflows, see Siebel Business Process Framework: Workflow Guide.
Define a JMS Connection subsystem using SrvrMgr (command line utility) or the Server Administration screen.
Note: Restart the Siebel Server to make the new subsystem available.Following is an example using SrvrMgr:
Note: ConnectionFactory, ReceiveQueue and SendQueue require JNDI names, which varies depending upon the JMS provider and your implementation.create named subsystem JMSToFromSiebel for subsystem JMSSubsys with ConnectionFactory="jndiName.ConnectionFactory", ReceiveQueue="jndiName.toSiebel ", SendQueue="jndiName.fromSiebel", ReceiveTimeout=3000
Define a data handling subsystem to dispatch the message from the toSiebel queue to the workflow as previously defined (JMS Query Order):
create named subsystem QueryOrder for subsystem EAITransportDataHandlingSubsys with DispatchWorkflowProcess="JMS Query Order"
Note: The Siebel Server must be restarted in order for the data handling subsystem to be available.After restarting the Siebel Server, start a new JMS Receiver from the SrvrMgr command line.
The following is an example that instructs the receiver to use the JMSToFromSiebel connection subsystem defined in Step 9, the QueryOrder data handling subsystem defined in Step 10, and instructs the receiver to use the ReceiveDispatchSend method of the EAI JMS Transport:
start task for comp JMSReceiver with ReceiverConnectionSubsystem= JMSToFromSiebel, ReceiverDataHandlingSubsystem=QueryOrder, ReceiverMethodName=ReceiveDispatchSend
Place a message resembling the following on the toSiebel queue:
Note: A third-party product such as Hermes (available from Sourceforge.net) is required to place a message on a queue. In the following sample document, the Siebel Order ASI queries for all orders associated with the Hibbings Manufacturing account.<?xml version="1.0" encoding="UTF-16"?> <SiebelMessage IntObjectName="Order Interface"> <ListOfOrderInterface> <Orders> <Account>Hibbings Manufacturing</Account> </Orders> </ListOfOrderInterface> </SiebelMessage>