Websphere MQ Sample

Hi

First of all I would like to say that I´m a complete newbie when it comes to webMethods. My first day at a new job :slight_smile:

What I would like to do is the following:
Receive an xml document and then forward it to an MQ server using the Websphere MQ adapter. I would then like to have a trigger or something waiting for a message to come back from the MQ Server.

Does anyone know if there are any good samples of how to accomplish this, or is there anyone how can give me some guidance?

I have studied the “webMethods 6 Integration Workshop” course (basic), but it was a few months ago so I don´t remember so much :confused:

Any help is appreciated.

Regards
Mikael

Mikael,

I believe the Websphere MQ Adapter User’s Guide (in the adapter services section) will show how to create adapter services to publish messages to MQ and to create an adapter notification to “listen” for messages to arrive on a specific MQ queue.

Receiving an XML file to kick off a Flow service is very straightforward. The Integration Server XML content handler will automatically convert the XML string to an IS node object. Your first Flow statement (enclosed in a try-catch set of sequences, of course, would be a built-in service such as pub.xml:nodeToDocument that maps the node object to an IS document type. From there you can extract a portion of the document or convert the entire thing to an XML string using the pub.xml:documentToXMLString built-in service.

Hope that gets you started,

Mark

Hi again

Thanks for the reply.

I have some trouble configuring an MQ Adapter connection using the IS administrator.

I followed the guide in “Websphere MQ Adapter Users Guide” and supplied all the correct information (Queue Manager name, hostname, port etc).
When I click the “Find Queues” button I receive an error:
Unable to obtain Queue Names:
com.wm.adk.error.AdapterServiceException: method (I[Ljava/lang/String;Ljava/lang/Throwable;)V not found -

Does anyone know how to solve this??

Regards
Mikael

Did you place all of the MQ jar files into the IS classpath?

Have you applied Service Pack 1 for the MQ Adapter? If you are running on IS 6.1 you may also need IS_6-1_Fix40 to address issue 1-RZM7R.

This may be one you will want to submit as a service request to WM Support.

Mark

Hi

Thanks for the replies, it really helped and I got it working now :slight_smile:

Regarding the “Find Queues” problem it was most likely a security setting on the mq server preventing me from listing all the available queues.

If I just entered the in/out queue names it worked fine.

Next problem:

I have a Listener which listen on a specific queue and uses Listener Notification service to notifiy whenever a message is available.
I have created a trigger which subscribes to the ListenerNotificationServicePublishDocument which invokes a service that only prints the msgbody to the debug log.

All this works great apart from one thing… the MsgBody is empty, which is very strange.
If I disable the listener and just invoke a service that gets the next message on the queue, it works just fine. How come the msgbody just “dissapear”?

Regards
Mikael

An update of the problem:

It is not just the msgBody parameter that is empty, the whole document is empty.

Any ideas anyone? :confused:

Regards

Mikael,

The input document name (on the input / output) panel of your service, must be the fully qualified name (folder.subfolder.documentTypeName) of your polling notification’s publishable document type. The data is probably being passed into your service, but is not in the document you expect. You can add a pub.flow:tracePipeline statment as the first line of your triggered service to test for this.

Mark