Tuesday, January 17, 2017

SoapUI and MQ on Windows

WebSphere MQ is a fairly complex piece of software, with concepts ranging from Connection Factories, Topics, Subscribers, Channels, etc. So getting SoapUI to connect to it requires a decent amount of technical know-how.
There's ample SoapUI documentation on picking up & sending messages to ActiveMQ, however for IBM MQ it's a bit sparse. This is an attempt to document, step by step, how to get SoapUI to quickly hook up to MQ, in Windows 7, taking into consideration UAC.
  1. Get WebSphere MQ Developer edition, if you don't have it already. I made the mistake of getting the evaluation trial.
  2. If working locally, create a queue manager in MQ, then open up command prompt, run "runmqsc ", and type "ALTER QMGR CHLAUTH(DISABLED)". You don't need to worry about channel authentication for development work, but if you insist, it took me some time to figure this out but you need to first create a server-connection channel (you had the option to do this on installation of MQ), open channel properties and under MCA, replace *NOACCESS with MUSR_MQADMIN (if using default domain/users).
  3. Go to %SOAPUI_HOME%/bin, open up "soapui.bat", and edit this line so it becomes:
    set CLASSPATH=%SOAPUI_HOME%soapui-5.3.0.jar;%SOAPUI_HOME%..\lib\*;C:\Program Files\IBM\WebSphere MQ\java\lib\*
    Then run this bat file as Administrator.
  4. Load up a WSDL in SoapUI. To save yourself some time, use the sample SoapUI SOAP tutorial which comes with the SoapUI installation. On Windows this is put in C:/Users/username/SoapUI-Tutorials by default.
  5. Run HermesJMS from within SoapUI. Configure the path to HermesJMS when it prompts you.
  6. Create a new session. This guide can take you through *most* of the way: Guide
    But you might get numerous errors about classes not being runnable. In my classpath group I ended up with this, just to be sure.
  7. If you left channel authentication on, you need to connect through the server-connection channel. Your session configuration needs to look like this:

    (And yes that's a Mac UI, Mac users can follow these instructions)
  8. Be careful not to leave "MQQueueConnectionFactory" as the Connection Factory for the session if you're getting classpath errors, otherwise your session will become corrupt and you'll need to delete the HermesJMS hermes-config.xml file and start over.
  9. Right click session, Discover, and HermesJMS should find all your queues.

No comments:

Post a Comment