Forum Discussion

Andrewdtc's avatar
Andrewdtc
New Contributor
7 years ago
Solved

Connect SoapUI to Weblogic 12.2.1 JMS

How do I connect SoapUI to Weblogic 12.2.1 JMS topics and queues?

  • Here's how I did it, pulling together things found by other people in slightly different situations.

     

    Note: I am assuming that you have Weblogic 12.2.1 JMS queues and topics already up and running.

     

     

    1. Install HermesJMS

    Here are the two links which proved most useful:

    https://fmwexperience.wordpress.com/2012/02/06/hermesjms-configuration-for-weblogic-11g/

    http://weblogicissuesolutions.blogspot.co.nz/2011/06/steps-to-configure-hermesjms-console-to.html

     

    This is what I added to the top of the hermes.bat. Adjust for your paths and java version (64-bit)

     

    REM Looks like it needs to be JRE rather than JDK
    set JAVA_HOME=C:\Java\jdk1.8.0_144\jre

    set PATH=
    set HERMES_HOME=C:\Tools\HermesJMS

    if "%HERMES_CONFIG%"=="" goto tryDotHermes
    goto setOtherVars

     

    2.  Start HermesJMS and connect to the Weblogic JMS session.

     

    Here are the settings I used in Hermes to connect to the Session

     

    Provider tab:

     

    Sessions tab:

     

     

    binding - javax/jms/QueueConnectionFactory
    initialContextFactory - weblogic.jndi.WLInitialContextFactory
    providerURL - t3://localhost:7001
    securityCredentials - welcome1
    securityPrincipal - weblogic

    3. Now connect HermesJMS to the JMS queues and topics

    Select the Session, right-click and select "Discover". 

    You should be able to see the messages on the queues and topics.

     

    Once you have HermesJMS working, then you can try with SoapUI.

     

    4. Ensure the hermes-config.xml is ready for SoapUI to use.

    Find the hermes-config.xml which you just modified (by default %HOME%\.hermes\hermes-config.xml ), and copy it to the place where you want it for your SoapUI project to use it. 

     

    5. Open SoapUI and adjust project

    Set the SoapUI project Hermes Config property to point to the hermes-config.xml in step 4.

    Add a (REST) service URI to the project

    Add a JMS endpoint to the service: Check that the Hermes Config is correct, the session matches what you created back in HermesJMS, and you select the queue or topic names to Publish and/or Subscribe from.

    Note: Apparently it is easier to add the queue and topic names in HermesJMS (or edit the hermes-config.xml directly).

     

    6. Add Test Steps

    Now you can "Add REST Request" test steps and use these endpoints to publish/subscribe messages and perform assertions as normal. (Details covered elsewhere)

     

     

     

     

     

     

     

2 Replies

  • Andrewdtc's avatar
    Andrewdtc
    New Contributor

    Here's how I did it, pulling together things found by other people in slightly different situations.

     

    Note: I am assuming that you have Weblogic 12.2.1 JMS queues and topics already up and running.

     

     

    1. Install HermesJMS

    Here are the two links which proved most useful:

    https://fmwexperience.wordpress.com/2012/02/06/hermesjms-configuration-for-weblogic-11g/

    http://weblogicissuesolutions.blogspot.co.nz/2011/06/steps-to-configure-hermesjms-console-to.html

     

    This is what I added to the top of the hermes.bat. Adjust for your paths and java version (64-bit)

     

    REM Looks like it needs to be JRE rather than JDK
    set JAVA_HOME=C:\Java\jdk1.8.0_144\jre

    set PATH=
    set HERMES_HOME=C:\Tools\HermesJMS

    if "%HERMES_CONFIG%"=="" goto tryDotHermes
    goto setOtherVars

     

    2.  Start HermesJMS and connect to the Weblogic JMS session.

     

    Here are the settings I used in Hermes to connect to the Session

     

    Provider tab:

     

    Sessions tab:

     

     

    binding - javax/jms/QueueConnectionFactory
    initialContextFactory - weblogic.jndi.WLInitialContextFactory
    providerURL - t3://localhost:7001
    securityCredentials - welcome1
    securityPrincipal - weblogic

    3. Now connect HermesJMS to the JMS queues and topics

    Select the Session, right-click and select "Discover". 

    You should be able to see the messages on the queues and topics.

     

    Once you have HermesJMS working, then you can try with SoapUI.

     

    4. Ensure the hermes-config.xml is ready for SoapUI to use.

    Find the hermes-config.xml which you just modified (by default %HOME%\.hermes\hermes-config.xml ), and copy it to the place where you want it for your SoapUI project to use it. 

     

    5. Open SoapUI and adjust project

    Set the SoapUI project Hermes Config property to point to the hermes-config.xml in step 4.

    Add a (REST) service URI to the project

    Add a JMS endpoint to the service: Check that the Hermes Config is correct, the session matches what you created back in HermesJMS, and you select the queue or topic names to Publish and/or Subscribe from.

    Note: Apparently it is easier to add the queue and topic names in HermesJMS (or edit the hermes-config.xml directly).

     

    6. Add Test Steps

    Now you can "Add REST Request" test steps and use these endpoints to publish/subscribe messages and perform assertions as normal. (Details covered elsewhere)