O'Reilly logo

Programming WCF Services, 2nd Edition by Juval Lowy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Queued Calls

WCF provides support for queued calls using the NetMsmqBinding. With this binding, instead of transporting the messages over TCP, HTTP, or IPC, WCF transports the messages over MSMQ. WCF packages each SOAP message into an MSMQ message and posts it to a designated queue. Note that there is no direct mapping of WCF messages to MSMQ messages, just like there is no direct mapping of WCF messages to TCP packets. A single MSMQ message can contain multiple WCF messages, or just a single one, according to the contract session mode (as discussed at length later). In effect, instead of sending the WCF message to a live service, the client posts the message to an MSMQ queue. All that the client sees and interacts with is the queue, not a service endpoint. As a result, the calls are inherently asynchronous (because they will execute later, when the service processes the messages) and disconnected (because the service or client may interact with local queues).

Queued Calls Architecture

As with every WCF service, in the case of a queued service the client interacts with a proxy, as shown in Figure 9-2.

Queued calls architecture

Figure 9-2. Queued calls architecture

However, since the proxy is configured to use the MSMQ binding, it does not send the WCF message to any particular service. Instead, it converts the call (or calls) to an MSMQ message (or messages) and posts it to the queue specified in the endpoint's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required