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

  1. 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.

  2. 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.

    1. Give the queue an easy-to-identify name such as toSiebel.

    2. 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.
  3. 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:

    1. EAI XML Convert (XMLDocToIntObjHier): Receives an incoming XML document and converts it to an integration object.

    2. Siebel Order ASI (QueryByExample): Executes a query using Siebel Order application service.

    3. EAI XML Converter (IntObjHierToXMLDoc): Converts the response to an XML document.


    Workflow to process the incoming XML request: This image is described in the surrounding text.
    Note: For details on the Business Process Designer, see Siebel Business Process Framework: Workflow Guide.
  4. 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

  5. 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

  6. 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

  7. 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>

  8. Save and deploy the workflow.

    For details on deploying workflows, see Siebel Business Process Framework: Workflow Guide.

  9. 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
    
  10. 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.
  11. 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
    
  12. 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>