Forum Discussion

fstach's avatar
fstach
New Contributor
15 years ago

Call Compiled Java Class for WMQ Request

Hi,

I'm new at the forum, sorry if that's a duplicated post.

I have a compiled Java class that I use from console to inject requests into some API's thru Websphere MQ. The code is quite simple, it converts the Request message into MQ format and put that on the request queue (which is already configured into the MQ cluster), the class also checks which is the reply queue at MQ layer (based on a .list file) and shows the response gotten. The command used goes like:

java -Xms64m -Xmx128m -classpath $CLASSPATH:$MQCALLLIBS MQClient REQUEST_QUEUE@QUEUE_MANAGER request_message.xml

How can I implement the Java class for doing MQ calls from SoapUI?

2 Replies

  • Hi fstach, welcome!

    Put your compiled JAR file (any any additional supporting libs) into <soapui_program_dir>/bin/ext
    Then in a Groovy Test Step withing soapUI, import your java package e.g.: import name.of.package.*;
    Create an object of your class and call methods on it. As for reading your 'request_message.xml' I'm not sure at the moment. Maybe either store it as a property in soapUI, or use groovy/java IO methods to read from the filesystem.

    Have a look at these posts for maybe some more clear explantion:
    viewtopic.php?f=5&t=7093
    viewtopic.php?f=2&t=7052

    Any of this make sense?
  • fstach's avatar
    fstach
    New Contributor
    Hi Unhandled, thanks by the reply.

    Yeah, it does make perfectly sense. I gotta work more on that. I did a quick research and seems it's more easy to use the code from my class directly from a Groovy to interact with the MQ packages and do the request, that's probably will make things easy on getting the response and passing the parameters. I'll try finishing it during the week and will post the findings.

    Thanks.