Simple request-reply client and server WCF sample
This sample demonstrates the IBM® MQ custom channel being used to start a Windows Communication foundation (WCF) service from a WCF client using a request-reply channel shape.
About this task
The sample has been configured with specific resource names as in the following procedure described. If you need to change the resource names, then you also need to change the corresponding value on the client application in the MQ_INSTALLATION_PATH \Tools\wcf\samples\WCF\requestreply\client\app.config file, and on the service application in the MQ_INSTALLATION_PATH \Tools\wcf\samples\WCF\requestreply\service\RequestReplyService.cs file, where MQ_INSTALLATION_PATH is 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. If you need to modify the sample solution and source, then you need an IDE, for example, Microsoft Visual Studio 8 or higher.
Procedure
- Create a queue manager called QM1
- Create a queue destination called SampleQ
- Create a queue destination called SampleReplyQ
- Start the service so the listener is waiting for messages: Run the MQ_INSTALLATION_PATH \Tools\wcf\samples\WCF\requestreply\service\bin\Release\SimpleRequestReply_Service.exe file, where MQ_INSTALLATION_PATH is the installation directory for IBM MQ.
- Run the client once: Run the MQ_INSTALLATION_PATH \Tools\wcf\samples\WCF\requestreply\client\bin\Release\SimpleRequestReply_Client.exe file, where MQ_INSTALLATION_PATH is the installation directory for IBM MQ.
Results
- The client puts a request message on SampleQ and waits for a response.
- The service gets the request message from SampleQ.
- The service adds and subtracts some values using the contents of the message.
- The service then puts the results into a message on SampleReplyQ, and waits for the client to put a new message.
- The client gets the message from SampleReplyQ and displays the results on the screen.