WCF client to an Axis Java service hosted by IBM MQ sample
Sample client applications and sample service proxy applications are supplied for both Java and .NET. The samples are based on a Stock Quote service that takes a request for a stock quote and then provides the stock quote.
Before starting
This sample requires that the .NET SOAP over JMS service hosting environment is correctly installed and configured in IBM MQ and is accessible from a local queue manager.When the .NET SOAP over JMS service hosting environment is correctly installed and configured in IBM MQ and is accessible from a local queue manager, additional configuration steps must be completed.
- Set the WMQSOAP_HOME environment variable to the IBM MQ installation directory, for example: C:\Program Files\IBM\MQ
- Ensure that the Java compiler javac is available and on the PATH.
- Copy the file axis.jar from the prereqs/axis directory of the WebSphere installation CD to the IBM MQ installation directory.
- Add to the PATH: MQ_INSTALLATION_PATH\Java\lib where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed, for example: C:\Program Files\IBM\MQ
- Ensure that the location of .NET is specified correctly in MQ_INSTALLATION_PATH\bin\amqwcallWSDL.cmd where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed, for example: C:\Program Files\IBM\MQ. The location of .NET can be specified for example: set msfwdir=%ProgramFiles%\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin
When the previous steps are complete, test and run the service:
- Navigate to your SOAP over JMS working directory.
- Enter one of the following commands to run the verification test and leave the service listener running:
- For .NET: MQ_INSTALLATION_PATH\Tools\soap\samples\runivt dotnet hold where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed.
- For AXIS: MQ_INSTALLATION_PATH\Tools\soap\samples\runivt Dotnet2AxisClient hold where MQ_INSTALLATION_PATH represents the directory where IBM MQ is installed.
The hold argument keeps the listeners running after the test completes. If errors are reported during this configuration, we can remove all the changes so that the procedure is restarted in the following way:
- Delete the generated SOAP over JMS directory.
- Delete the queue manager.
About this task
The sample demonstrates a connection from a WCF client to the Axis Java SOAP over JMS sample service provided in IBM MQ using a one-way channel shape. The service implements a simple StockQuote example, which outputs a text string to a file which is saved in the current directory.The client has been generated by using WSDL to generate client files as described in Generating a WCF client proxy and application configuration files using the svcutil tool with WSDL
The sample has been configured with specific resource names as described in this paragraph. For to change the resource names, then we must also change the corresponding value on the client application in the MQ_INSTALLATION_PATH \tools\wcf\samples\WMQAxis\default\client\app.config file, and on the service application in the MQ_INSTALLATION_PATH \tools\wcf\samples\WMQAxis\default\service\WmqDefaultSample_StockQuoteDotNet.wsdl file, where MQ_INSTALLATION_PATH represents the installation directory for IBM MQ.