Welcome!

Java Authors: Maureen O'Gara, Bruce Armstrong, Liz McMillan, Walter H. Pinson, III, Yakov Werde

Related Topics: Java

Java: Article

Java Feature — A Generic JMS Listener for Apache Axis 1.x

A needed transport-level handler

Running the Listeners
Install OpenJMS and Axis. Unzip the download.zip into a windows folder named, say, A. Modify the setclasspath.bat to give the correct value for Axis Home and openjms home. Put the server-config.wsdd in your Axis installation's (the axis zone of your web server's webapp) WEB-INF folder if there is none already. If you already have this file then copy the two service element entries in full to the already existing server-config.wsdd. Define three queues in openjms.xml, i.e., one for each Web Service given in jmswebsvcs.xml and one for "replyq," which is the reply queue used by the client. Change the GenericJMSSOAPListenerForAxis code line at the top to specify the full path of your Axis installation's server-config.wsdd file. Compile the source code to create .class files. Put the .class files in folder A with the right package structure. Now start openjms. Go to folder A in the DOS command prompt. Run setclasspath.bat. Then start the JMS listeners using the command java jms.AxisJMSListenersStarter.

Now, to run the test client, open another command prompt window. Go to folder A. Run setclasspath.bat. Use the command java invoker.jms.JMSTestClientRPC to run the JMS RPC client. Then use the command java invoker.jms.JMSTestClientMessageStyle to run the JMS message service client. Make sure that folder A contains the client-config.wsdd and that folder A is first in the class path order.

Summary
This article has introduced a working JMS listener for use with Apache Axis 1.x and has shown how clients can uniquely address Axis Web Services for invocation over JMS and how they invoke them over JMS using a combination of this listener and custom-written JMS transport handlers.

The source code for this solution can be downloaded from the online version of this article at http://java.sys-con.com.

Resources

More Stories By Parameswaran Seshan

Parameswaran Seshan is a Senior architect with E-Comm Research Lab, Infosys Technologies Limited, Bangalore, India. He has around 14 years of work experience in the IT industry, involving research, teaching, architecture, and programming. His areas of interest include Process-centric architecture, Intelligent software systems, software architecture, Business Process Management systems, Web services and Java.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.