Configuring SoapUI for JMS services using Hermes JMS

Web services use multiple protocols for transport, for example, HTTP or JMS. Communication can also be different, for example, Soap or JSON. So let's go configure JMS for different middleware like Tibco,Oracle SOA, IBM WebSphere.

To configure JMS in SoapUI we have a utility called Hermes JMS to help us configure JMS in our test.

Following are the steps to configure Hermes JMS in SoapUI:

  1. Open HermesJMS from the Tools option on the top and select HermesJMS:
    Configuring SoapUI for JMS services using Hermes JMS
  2. Verify that HermesJMS will open on your desktop:
    Configuring SoapUI for JMS services using Hermes JMS
  3. Configuring a session: Select a New Session:
    Configuring SoapUI for JMS services using Hermes JMS
  4. Configuring a New session: On selection of a new session, verify that the Preferences window comes up:
    Configuring SoapUI for JMS services using Hermes JMS
  5. On the Preferences window select the Providers tab.
    Configuring SoapUI for JMS services using Hermes JMS
  6. On selection of a New Group add the Jars based on the middleware used, for example, for Tibco, use the following JARS:
    • Tibemsd.JAR
    • Tibjms.jar
    • Tibjmsadmin.jar
  7. For Active MQ use the following:
    • com.ibm.mq.pcf-6.1.jar
    • com.ibm.mq.jar
    • com.ibm.mqjms.jar
    • dhbcore.jar
    • connector.jar
  8. After adding the Jars click on Apply and move to the Sessions tab.
  9. From the Sessions tab, repeat the following steps in the following sequence:
    1. Select the Loader and select the name of the Class path group you created in the Providers tab.
    2. Select Class:Com.tibco.tibjms.TibjmsQueueConnectionFactory for TIBCO.
    3. Select the plugin with the relevant Plugin name. For Tibco, select Tibco EMS; for IBM, select IBM WebSphere.
    4. After that click on the Apply button.
    Configuring SoapUI for JMS services using Hermes JMS
  10. On the left hand pane, select the session name provided and right click on it.
    Configuring SoapUI for JMS services using Hermes JMS
  11. Select the Discover option. You will then have all of the queues discovered.
  12. Open SoapUI and move to the binding of the JMS service and right click on it.
    Configuring SoapUI for JMS services using Hermes JMS
  13. On selecting to Add JMS endpoint you will be routed to the Add JMS endpoint window:
    Configuring SoapUI for JMS services using Hermes JMS
  14. Select the Session and then the Send Queue from the list of the queues:
    Configuring SoapUI for JMS services using Hermes JMS

Now let's take an example of configuring the request for JMS messages:

  1. Open the request and configure the endpoint with the queue name and then add ::queue_ at the end of the queue. So any JMS endpoint in SoapUI would be like the following:
    Jms//session name::sendingQueue::receiving queue
    

    Here you are having queue_ as a temporary queue in SoapUI to receive the response and acting as a receiving queue.

    Configuring SoapUI for JMS services using Hermes JMS
  2. Select the two checkboxes from the JMS headers option:
    Configuring SoapUI for JMS services using Hermes JMS

Let's have a look at the options shown in the preceding screenshot:

  • JMSCorrelationID: This is used to map the request and response message in a transaction
  • JMSReplyTo: This describes the queue or a topic to which the response must be sent
  • JMSType: This field indicates the nature of the message enumeration may vary based on the JMS vendor
  • JMSPriority: The priority at which the message is sent range varies from 0 to 9 with 0 as least, and 9 as most important
  • JMSDeliveryMode: It has two enumerations:
    • PERSISTENT: Message is stored in a store
    • NON PERSISTENT: Message is not stored in a store
  • TimeToLive: The time the message should exist on the queue till
  • Send As Bytes Message: This option, when selected, sends the message as bytes
  • Add SoapAction as property: This option when checked adds SoapAction to the request
  • Durable Subscription Name: Name of the durable subscription
  • ClientID: Used to uniquely identify any durable subscriber
  • Message Selector: Allows you to filter the messages that a Message Consumer will receive

After this you can successfully launch a test against all JMS services.

You can also use the script from the following section to send any JMS messages on a destined queue.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.86.211