Deploying a web service client to Axis 1.4 to use IBM MQ transport for SOAP

Prepare a deployment directory and deployment descriptor for the client. Provide the client proxies and client class, and set up the CLASSPATH. Configure IBM MQ queues and channels, start the service and test the client.


Before you begin

Tip: Deploy the service to HTTP, develop and test the client for HTTP, and then modify the client for IBM MQ transport for SOAP:
  1. Add the Register.extension() call to the client.
  2. Change the static web service address in the client proxy locator class to use the URI for the IBM MQ transport for SOAP.


Deploying an Axis 1.4 client to use IBM MQ transport for SOAP requires one additional deployment step compared to an HTTP client. You must create a client deployment descriptor, client-config.wsdd, to map the jms: transport to the sender class com.ibm.mq.soap.transport.jms.WMQSender.

If we use the command amqwdeployWMQService to generate client proxies, we can deploy the client using the directories the command generates.


Procedure

  1. Create a directory deployDir to hold the client deployment files.
  2. Open a command window on Windows systems, or a command shell using X Window System on UNIX and Linux systems, in deployDir.
  3. Run the amqwsetcp.cmd command to set the CLASSPATH
  4. Run the amqwclientconfig.cmd command to create an Axis 1.4 client deployment descriptor, client-config.wsdd in deployDir.
  5. Make sure the classes in the client package, the client proxy classes, and the libraries the client uses, are in the CLASSPATH.

    amqwdeployWMQService places the .NET client proxies into ./generated/server/soap/client/remote/dotnetService and the Axis 1.4 proxies into ./generated/server/soap/client/remote/client package.


Example

The example shows the configuration and output, Figure 3, from an Axis 1.4 Java client. The client, Figure 2, calls a web service that echoes its input parameter. The service definition, Figure 1, shows the URI taken from the service WSDL.

Figure 1. Service definition
<wsdl:service name="QuoteSOAPImplService">
    wsdl:port binding="intf:org.example.www.QuoteSOAPImplBindingSoap"
                       name="org.example.www.QuoteSOAPImpl_Wmq">
       <wsdlsoap:address location="jms:/queue?destination=REQUESTAXIS
           &connectionFactory=(connectQueueManager(QM1)binding(server))
           &initialContextFactory=com.ibm.mq.jms.Nojndi
           &targetService=org.example.www.QuoteSOAPImpl.java
           &replyDestination=SYSTEM.SOAP.RESPONSE.QUEUE" />
    </wsdl:port>
</wsdl:service>
Figure 2. Axis 1.4 Java client
package org.example.www;
import com.ibm.mq.soap.Register;
public class QuoteClient {
   public static void main(String[] args) {
      try {
         Register.extension();
         QuoteSOAPImplServiceLocator locator = new QuoteSOAPImplServiceLocator();
         System.out.println("Response = " 
                  + locator.getOrgExampleWwwQuoteSOAPImpl_Wmq().getQuote("IBM"));
      } catch (Exception e) {
         System.out.println("Exception = " + e.getMessage());
      }
   }
}
Figure 3. Client configuration and output
C:\IBM\ID\Test>dir /s /b
C:\IBM\ID\Test\client-config.wsdd
C:\IBM\ID\Test\org
C:\IBM\ID\Test\org\example
C:\IBM\ID\Test\org\example\www
C:\IBM\ID\Test\org\example\www\GetQuoteFaultMsg.class
C:\IBM\ID\Test\org\example\www\OrgExampleWwwQuoteSOAPImplBindingSoapStub.class
C:\IBM\ID\Test\org\example\www\QuoteClient.class
C:\IBM\ID\Test\org\example\www\QuoteSOAPImpl.class
C:\IBM\ID\Test\org\example\www\QuoteSOAPImplService.class
C:\IBM\ID\Test\org\example\www\QuoteSOAPImplServiceLocator.class

C:\IBM\ID\Test>amqwsetcp
C:\IBM\ID\Test>java org.example.www.QuoteClient.class
Response = IBM


What to do next

  1. If you are deploying the client as an IBM MQ client, configure the client and server connection channel.
  2. If you are deploying the client to a different queue manager to the service, you must make the destination queue available to the client. Configure the destination queue on the service queue manager as a cluster queue, or on the client queue manager as a remote queue definition.