Consuming a WCF service with a raw MSMQ program
WCF provides built-in NetMsmqBinding for developing services over the MSMQ transport layer. However, the NetMsmqBinding totally encapsulates the underlying details of the MSMQ programming layer so that a developer only needs to focus on the WCF service programming model and object model. This is good for pure WCF applications; however, for some scenarios where the client side is a legacy MSMQ program, the NetMsmqBinding will not work and we will need a means to make the WCF service interoperable with the raw MSMQ API-based client.
In this recipe, we will demonstrate how to use the WCF MsmqIntegrationBinding to make a WCF service work correctly with a raw MSMQ (System.Messaging
)-based client application.
How to do it...
Unlike most sample cases used in other recipes, here we will build the client application first and then generate a WCF service application to interoperate with the client. Here are the detailed steps:
Create a raw MSMQ-based client...