soap over jms with soapui

14
Sop U SOAP over JMS with Configuring soapUI to test TIBCO SOAP over JMS - Seshasai Kotipalli

Upload: marian433

Post on 06-Nov-2015

48 views

Category:

Documents


4 download

DESCRIPTION

how config SOAP Over JMS with soapUI

TRANSCRIPT

  • Sop U

    SOAP over JMS with

    Configuring soapUI to test TIBCO SOAP over JMS

    - Seshasai Kotipalli

  • Using soapUI for testing SOAP over JMS services

    2

    Summary

    1 Introduction ............................................................................................................. 3

    2 Installation ............................................................................................................... 4

    3 Hermes Configuration ............................................................................................. 5

    4 Configuring JMS endpoints in soapUI ................................................................... 8

    5 Correlating SOAP over JMS Responses for Static reply destinations .............. 12

  • Using soapUI for testing SOAP over JMS services

    3

    1 Introduction

    This document explains the procedure to setup Eviware soapUI tool to test SOAP over JMS services exposed by TIBCO ActiveMatrix BusinessWorks and TIBCO ActiveMatrix service grid.

  • Using soapUI for testing SOAP over JMS services

    4

    2 Installation

    Download and install soapUI version that has HermesJMS bundled with it from either www.eviware.com or www.soapui.org. Generally the exe version has HermesJMS bundled with it. Select HermesJMS option when installing the product as shown below.

  • Using soapUI for testing SOAP over JMS services

    5

    3 Hermes Configuration

    After the installation is complete, start hermes from either \hermesJMS\bin\hermes.bat or by clicking HermesJMS from within soapUI tools menu and configure as specified below.

    1. Create a new session: Right click on sessions->New->New Session->type a new session name. Go to providers section by clicking on Providers tab Right click on the Classpath Groups and add a group and provide a name Right click on the Library and select Add JAR(s) and add tibjms.jar and tibjmsadmin,jar from \lib\ folder. Click Apply and OK and Save the settings using File->Save Settings.

  • Using soapUI for testing SOAP over JMS services

    6

    2. Edit the session: Right click on the session created and choose Edit and it will take you to Sessions section Select the classpathgroup created at step#1 from the dropdown box against Loader and Apply. Choose com.tibco.tibjms.TibjmsConnectionFactory as the Connection Factory Class. Select Tibco EMS from the Plug In dropdown. Right click on the canvas below Plug In selection add serverURL, username and password properties

    with appropriate values as shown below. Also, make sure to add the serverUrl,username and userPassword at ConnectionFactory settings, otherwise it will always tries to connect to tcp://localhost:7222

    Click Apply and OK to close the Preferences dialog and save settings using File->Save Settings.

  • Using soapUI for testing SOAP over JMS services

    7

    3. Right click the session and click discover, it should connect to ems server and list the destinations if its configured correctly.

    4. Please make sure the request and reply queues are created prior to running the discover step. If not, create them now and retry the discover option. Save settings and exit HermesJMS configuration tool. The HermesJMS configuration is stored typically in c:\.hermes folder. Check the contents of this folder; it should have hermes-config.xml. This location is needed for configuring soapUI as detailed in next section.

  • Using soapUI for testing SOAP over JMS services

    8

    4 Configuring JMS endpoints in soapUI

    1. Adding JMS endpoint to soapUI project

    Create or edit a soapUI project based on a concrete wsdl (SOAP over HTTP wsdl is also fine) Right click on the interface, select Add JMS endpoint and specify Hermes Config location, Session

    name, send and receive JMS destination names. The Hermes Config folder is the location where the settings are saved while configuring the HermesJMS as described in section #3.

    If a non-default location is used for Hermes Config specify appropriate folder, the default location on windows is c:\.hermes.

    If right destinations are listed in the drop down for send and receive destinations, make sure those destination names are created in EMS server and redo the discover as described above. If you would like to use temp destination for replies, leave the Receive/Subscribe destination value empty.

  • Using soapUI for testing SOAP over JMS services

    9

    2. In the soapUI request editor, Select JMS endpoint with the format shown in the screenshots below. For static reply destinations,

    endpoint should contain both request and reply destinations. The endpoint will be jms://ems::queue_bw.soap.jms::queue_ for temp destinations. The queue_ value at the end of the string indicates a temp destination is used for replies. See the screenshot below for both static reply and temp reply destinations.

    Fill in the replyTo destination in JMS Headers tab. This is only required if you have chosen static reply destination in Receive/Subscribe destination. For temporary reply destinations this step is not required.

    Add SOAPAction by clicking on + symbol in JMS Properties tab with appropriate value as shown below. Trigger soapUI to test it out. SOAPAction is required for both static and temp reply scenarios.

  • Using soapUI for testing SOAP over JMS services

    10

  • Using soapUI for testing SOAP over JMS services

    11

    The following screenshot shows configuration for temp destination format, JMSReplyTo header should not be set, SOAPAction property is required the same way as static reply case. , ,

  • Using soapUI for testing SOAP over JMS services

    12

    5 Correlating SOAP over JMS Responses for Static reply

    destinations

    When temporary destinations are used as reply destinations, there is no need to do additional correlation as the temp destination names are unique. When static reply destinations are used, correlation is required to make sure a response is properly matched to the corresponding request. This is especially true when performing load tests. Response correlation can be done in soapUI as described below.

    1. Create a Send Step: Right click on the soapUI project created in above section, and add a New TestSuite and provide a name. Right click on the TestSuite and add a New TestCase and provide a name. Right click on the TestCase and add a step of type Test Request and provide a name. In the following

    screen shot, its named JMSSend. Choose the right operation as guided by soapUI. Click on the endpoint dropdown and add a new endpoint and specify the endpoint URI in the format

    shown in the screenshot. It should only request destination. In this example, URI is jms://ems::queue_bw.soap.jms. Here ems refers to the session created in Hermes and bw.soap.jms is the destination name that the actual service request destination.

    Click the JMS Headers tab and add JMSReplyTo destination value. Click on JMS Properties and add SOAPAction with appropriate value by clicking on the + sign. Remove/disable any assertions by clicking on Assertions button

  • Using soapUI for testing SOAP over JMS services

    13

  • Using soapUI for testing SOAP over JMS services

    14

    2. Create a Receive Step: Add a new test step of type Test Request and name it JMSReceive and select the same operation

    that was selected for JMSSend step. Delete the request content as this step is only used to receive the response. Click on the endpoint drop down list and add a new endpoint and specify the endpoint URI as

    jms://ems::-::queue_bw.soap.jms.reply. Here ems refers to the hermes session name and bw.soap.reply is the reply destination. Do not use edit endpoint option as it will change the endpoint for JMSSend also.

    Click on the JMS headers and add a Message Selector as JMSCorrelationID='${=context.getProperty("JMS_MESSAGE_SEND").getJMSMessageID()}' The SOAP over JMS response from both BW and AMSG will have the MessageID of request sent back as correlationID, so the request and response are matched with the above selector

    Remove/disable any assertions.

    2. Test the scenario by executing the test case, instead of each step.