WCF client to a .NET service hosted by IBM MQ sample
Sample client applications and sample service proxy applications are supplied for both .NET and Java. The samples are based on a Stock Quote service that takes a request for a stock quote and then provides the stock quote.
Before you begin
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 production directory, for example: C:\Program Files\IBM\MQ\java\lib\soap
- Add to the PATH:
MQ_INSTALLATION_PATH
\Java\lib whereMQ_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 whereMQ_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
- 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 holdMQ_INSTALLATION_PATH
represents the directory where IBM MQ is installed. - For AXIS:
MQ_INSTALLATION_PATH
\Tools\soap\samples\runivt Dotnet2AxisClient holdMQ_INSTALLATION_PATH
represents the directory where IBM MQ is installed.
- For .NET:
hold
argument keeps the listeners running
after the test completes.
- Delete the generated SOAP over JMS directory.
- Delete the queue manager.
About this task
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 the following procedure. If you need to change the resource names, then you must also change the corresponding value on the client application in the MQ_INSTALLATION_PATH
\tools\wcf\samples\WMQNET\default\client\app.config file, and on the service application in the MQ_INSTALLATION_PATH
\tools\wcf\samples\WMQNET\default\service\WmqDefaultSample_StockQuoteDotNet.wsdl file, where MQ_INSTALLATION_PATH
represents the installation directory for IBM MQ. For more information about formatting the JMS endpoint URI, see IBM MQ Transport for SOAP in the IBM MQ product documentation.
Procedure
MQ_INSTALLATION_PATH
\tools\wcf\samples\WMQNET\default\client\bin\Release\TestClient.exe file, where MQ_INSTALLATION_PATH
represents the installation directory for IBM MQ.
Results
Hello World
five times on the screen.