Forum Discussion

Alejandro21's avatar
Alejandro21
Occasional Contributor
10 years ago

Websphere MQ XML injection using SoaUI/Hermes

Hi,

we started a project that will inject XML messages using websphere MQ, we are exploring if we can do this using SoapUI/Hermes. Following the online help, I already managed to setup a WMQ session in Hermes and interact with a queue without issues. The problem comes when I try to implement some load testing using SOAP UI. This is not a SOAP or REST project, so is there a way I can create my own interface on a Generic project without a WSDL or WADL and the associate a JMS endpoint to it? I understand SoapUI is intended to interact with web services, but I was hoping to use to it to create my own XML requests, called them from test cases, send them to my JMS endpoint (just the plan xmls, without SOAP envelope) and use SoapUI functional testing capabilities. Is this possible with SoapUI? Which options we might have? Maybe Groovy scripts?

Thanks in advance!!!

Alejandro

8 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    This is not a SOAP or REST project, so is there a way I can create my own interface on a Generic project without a WSDL or WADL and the associate a JMS endpoint to it?


    No, just use a "dummy" WSDL or WADL. Basically, it does not have to conform to the messages you are trying to send to the queues.

    I understand SoapUI is intended to interact with web services, but I was hoping to use to it to create my own XML requests, called them from test cases, send them to my JMS endpoint (just the plan xmls, without SOAP envelope) and use SoapUI functional testing capabilities. Is this possible with SoapUI? Which options we might have? Maybe Groovy scripts?


    You can put what you want to send in the xml editor including free form text or use property expansion to send to the queues with JMS. One example of using a property expansion is below.

    http://screencast.com/t/nW1VXnQG

    For sending binary messages please see this documentation below.

    http://www.soapui.org/JMS/sending-arbit ... sages.html


    Regards,
    Marcus
    SmartBear Support
  • Alejandro21's avatar
    Alejandro21
    Occasional Contributor
    Hi Marcus, sorry for the late response, I was out of the office for some days. Thanks for your response, I will try doing that. I have one more question. We noticed that adding a webpshere mq endpoint only works with SoapUI Pro. We tried adding one with the SoapUI open version, and even though we managed to setup the session in Hermes, such WMQ session is not avaible when trying to add the endpoint to a SoapUI Interface. Could you please confirm that behavior?

    Thanks
  • Alejandro21's avatar
    Alejandro21
    Occasional Contributor
    After adding another WebsphereMQ session to Hermes without problems, I cannot select any WebsphereMQ-based session when I try to add a JMS endpoint to a SoapUI Interface. I just checked directly in Hermes and everything works fine, I can query queues from all the websphereMQ sessions I've created and I also checked that the SoapUI JMS endpoint configuration is correctly pointing to the directory where the hermes-config.xml is found.But the only session available is "Files" which I guess is part of the default configuration.

    Does anyone have an idea of what might be wrong? I guess I'm missing some kind of configuration, but not sure which and I can't find anything else needed in the Working With JMS messages tutorial. I'm attaching a copy of my hermes-file config just in case.

    Thanks,

    Alejandro
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    The config file looks OK. Can you check in SoapUI Pro at File -> Preferences -> Tools, HermesJMS that it points to a HermesJMS location such as C:\Program Files\SmartBear\SoapUI-Pro-5.1.1\hermesJMS? Also, are you using the bundled version of HermesJMS that is part of the SoapUI Pro install?



    Regards,
    Marcus
    SmartBear Support
  • Alejandro21's avatar
    Alejandro21
    Occasional Contributor
    Hi Marcus,

    just checked and here's where File->Preferences->Tools->HermesJMS point to
    D:\Program Files\SoapUI-Pro-5.0.0\hermesJMS
    So I guess that's not the problem.
    I am using the bundled version of HermesJMS and I have no problem launching it from SoapUI.
    I checked about the WebSphereMQ jar files I should copy to SoapUI's hermes/lib folder and these is what I see in the SoapUI Pro log when I want to add a JMS endpoint:

    Thu Aug 07 20:18:53 EDT 2014:INFO:Added [file:/D:/Program%20Files/SoapUI-Pro-5.0.0/hermesJMS/lib/com.ibm.mq.jar] to classpath
    Thu Aug 07 20:18:53 EDT 2014:INFO:Added [file:/D:/Program%20Files/SoapUI-Pro-5.0.0/hermesJMS/lib/com.ibm.mq.pcf.jar] to classpath
    Thu Aug 07 20:18:53 EDT 2014:INFO:Added [file:/D:/Program%20Files/SoapUI-Pro-5.0.0/hermesJMS/lib/com.ibm.mqjms.jar] to classpath
    Thu Aug 07 20:18:53 EDT 2014:INFO:Added [file:/D:/Program%20Files/SoapUI-Pro-5.0.0/hermesJMS/lib/connector.jar] to classpath
    Thu Aug 07 20:18:53 EDT 2014:INFO:Added [file:/D:/Program%20Files/SoapUI-Pro-5.0.0/hermesJMS/lib/dhbcore.jar] to classpath

    I guess these means thewebspehre mq jar files are loaded without problems.
    I noticed that if I add another session in Hermes using the system classpath I can see it without problems from SoapUI. So it seems that there's a problem accessing a session created using the WMQ loader I created in Hermes for WebsphereMQ. Any other idea of anything else I can check?


    Thanks!

    Alejandro
  • Alejandro21's avatar
    Alejandro21
    Occasional Contributor
    Hi Marcus,

    I found this previous post with the exact problem
    viewtopic.php?f=2&t=22792&p=52116&hilit=websphere+mq&sid=431ba96d745a216245ee121de8422af8#p52116

    So, I decided to reinstall SoapUI Pro and it's working now. Weird, not sure what's different. If you have any idea of what could have happened, let me know.

    Now that I was able to setup my jms endpoint, I tried testing it and I received the following error.

    Fri Aug 08 10:50:56 EDT 2014:ERROR:Exception in request: com.eviware.soapui.impl.wsdl.submit.RequestTransportRegistry$CannotResolveJmsTypeException:
    Bad jms alias!
    For JMS please use this endpont pattern:
    for sending 'jms://sessionName::queue_myqueuename'
    for receive 'jms://sessionName::-::queue_myqueuename'
    for send-receive 'jms://sessionName::queue_myqueuename1::queue_myqueuename2'
    Fri Aug 08 10:50:56 EDT 2014:ERROR:An error occurred [
    Bad jms alias!
    For JMS please use this endpont pattern:
    for sending 'jms://sessionName::queue_myqueuename'
    for receive 'jms://sessionName::-::queue_myqueuename'
    for send-receive 'jms://sessionName::queue_myqueuename1::queue_myqueuename2'], see error log for details
    Fri Aug 08 10:50:57 EDT 2014:INFO:Error getting response for [DispatchWorkOrderSoap.OpGetDispatchWorkOrder:Test Request]; com.eviware.soapui.impl.wsdl.submit.RequestTransportRegistry$CannotResolveJmsTypeException:
    Bad jms alias!
    For JMS please use this endpont pattern:
    for sending 'jms://sessionName::queue_myqueuename'
    for receive 'jms://sessionName::-::queue_myqueuename'
    for send-receive 'jms://sessionName::queue_myqueuename1::queue_myqueuename2'

    It basically says that I'm using a wrong jms alias. This is how my endpoint is configured
    jms://BTE::VC - NSC::queue_INBOUND.REQUEST::queue_LOCAL.INBOUND.RESPONSE.SAVE
    I didn't change the pattern, it is just the way it was built when I created the jms endpoint.

    Any idea of where/what to start checking?

    Thanks,

    Alejandro
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Alejandro,

    So, I decided to reinstall SoapUI Pro and it's working now. Weird, not sure what's different. If you have any idea of what could have happened, let me know.


    I'm not sure, kind of strange that you had to reinstall for it to work.


    jms://BTE::VC - NSC::queue_INBOUND.REQUEST::queue_LOCAL.INBOUND.RESPONSE.SAVE


    That pattern does not look right, a typical jms endpoint in SoapUI Pro should look similar to jms://ActiveMQSession::queue_Q1::queue_Q1. What looks to be throwing it off is "BTE::VC - NSC", what is the session name that you configured in HermesJMS? It should not contain any double colons in the name i.e ::


    Regards,
    Marcus
    SmartBear Support
    • qweasd1's avatar
      qweasd1
      Regular Visitor
      I have configured HermesJMS and was able to browse and send messages to WebSphereMQ but when I use the JMS endpoint to send request from SOAPUI I keep getting authentication error below. Am I missing something in my SOAPUI configuration?

      MQJMS2013: invalid security authentication supplied for MQQueueManager