Deploying a web service client to .NET Framework 1 and 2 to use IBM MQ transport for SOAP

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


Before you begin

Tip: Develop and test the service and the client using Visual Studio. Then modify the client for IBM MQ transport for SOAP.
  1. If you are deploying a service using .NET Framework 1 or 2, build the service as a library ( .dll ). Deploy using IBM MQ transport for SOAP.
  2. Add the Register.Extension() call to the client.
  3. Add a reference to amqsoap.dll, which is located in MQ_Install\bin.
  4. Change the static Url property in the client proxy class constructor to the jms:/ URI, for IBM MQ transport for SOAP.


About this task

Deploying a web service client for .NET Framework 1 or 2 to use IBM MQ transport for SOAP requires an additional deployment step. You need to register amqsoap.dll with the .NET Framework. amqsoap.dll is automatically registered as part of installing IBM MQ transport for SOAP, but you might need to register it again.

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 in deployDir.
  3. Run amqwsetcp to set the CLASSPATH if the service is to run on Axis 1.4.
  4. If necessary, run amqwRegisterDotNet to register amqsoap.dll with the .NET Framework.


Example

The example shows the configuration and output, Figure 3, from an .NET Framework V2 client. The client, Figure 2, calls a web service that echoes its input parameter. The static Url definition, Figure 1, shows the constructor for the client proxy.

Figure 1. Static client proxy constructor
public Quote() {
    this.Url = "jms:/queue?destination=REQUESTDOTNET
               &connectionFactory=(connectQueueManager(QM1)binding(server))
               &initialContextFactory=com.ibm.mq.jms.Nojndi
               &targetService=Quote.asmx
               &replyDestination=SYSTEM.SOAP.RESPONSE.QUEUE";         
}
Figure 2. Client program
using System;
namespace QuoteClientProgram {
    class QuoteMain {
        static void Main(string[] args) {
            try {
                IBM.WMQSOAP.Register.Extension();
                Quote q = new Quote();
                Console.WriteLine("Response is: " + q.getQuote("ibm"));
            } catch (Exception e) {
                Console.WriteLine("Exception is: " + e);
            }
        }
    }
}
Figure 3. Configuration and output
C:\IBM\ID\DotNet\QuoteClientProgram\QuoteClientProgram>dir /s /b
C:\IBM\ID\DotNet\QuoteClientProgram\QuoteClientProgram\QuoteClientProgram.exe
C:\IBM\ID\DotNet\QuoteClientProgram\QuoteClientProgram>quoteclientprogram
Response is: IBM


What to do next

  1. If you are deploying the client as an IBM MQ MQI 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.