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

Instance Management

The contract session mode and the service instance mode have a paramount effect on the behavior of the queued calls, the way the calls are played back to the service, and the overall program workflow and allowed assumptions. The MSMQ binding cannot maintain a transport session in the connected sense, since the client is inherently disconnected. Instead, the equivalent MSMQ concept is called a sessiongram. If the contract is configured with SessionMode.Allowed (the default) or SessionMode.NotAllowed, there will be no sessiongram. Every call the client makes on the proxy will be converted to a single WCF message, and those WCF messages will be placed in individual MSMQ messages and posted to the queue. A client making two calls on the proxy will result in two MSMQ messages. If the contract is configured with SessionMode.Required, all the calls made by the client against the same proxy will be packaged in a single MSMQ message, in the order in which they were made and posted to the queue. On the service side, WCF will play the calls from the MSMQ message in the order they were made (like a recording) to the same service instance. This mode is therefore analogous to a transport session and a sessionful service.

Per-Call Queued Services

In the case of a per-call service, the client has no way of knowing whether its calls will eventually end up being played to a queued per-call service. All the client sees is the session mode of the contract. If the session mode is either ...

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