Forum Discussion

shakor's avatar
shakor
Occasional Contributor
9 years ago

Sending JMS message as response to SOAP request

Hello,

 

I need to mock the behaviour of receiving a SOAP message on a WSDL endpoint (which I have mocked in SOAP UI) but then I need to take the/some data of that request and put it on a JMS queue. Is that possible to do with SOAP UI?

  • Hi, sorry to but in Rao, but I think Shakor might actually be looking for a way to create a JMS message from a Mock's Groovy script when it recieves a request?

     

    If so, my take on this would be to do it programatically using a Groovy OnRequest script in the mock. Personally I don't find the Hermes integration that great (also I think the Hermes project has gone dormant? Could be wrong), instead I would use the ActiveMQ libraries. I saw someone might have done something useful that could help get you started with the code if this approach suites you:

     

    https://gist.github.com/welshstew/45aa6f42f847fce25593

     

    Another way I have integrated SoapUI with ActiveMQ JMS is via its REST API, that worked quite well and required less coding. I guess you could also write Groovy code in the mock to create a JMS message by calling the REST API (assuming you are using Active MQ or your implementation has a REST API option)...

     

    Hope this helps, sorry if its also not want you want to do!

     

    Cheers,

    Rupert

     

    • shakor's avatar
      shakor
      Occasional Contributor

      Yes thanks, I have checked those docs already. But it does not tell you how to put a message on a JMS queue, in SOAP UI, as a response of getting a SOAP request.

       

      So for example, if I would have Mockservice, which is mocked MockService in SOAP UI, when a SOAP Request comes into for that mocked Webservice then I can extract the request using Script Dispatch but it is not clear that from there, how do I put the request on a JMS queue. If even possible, in SOAP UI.

      • nmrao's avatar
        nmrao
        Champion Level 3
        You only need to mock? clarify, please.