One-Way Operations

There are cases when an operation has no returned values, and the client does not care about the success or failure of the invocation. To support this sort of fire-and-forget invocation, WCF offers one-way operations. Once the client issues the call, WCF generates a request message, but no correlated reply message will ever return to the client. As a result, one-way operations cannot return values, and any exception thrown on the service side will not make its way to the client. Ideally, once the client calls a one-way method, it should be blocked only for the briefest moment it takes to dispatch the call. However, in reality, one-way calls do not equate asynchronous calls. When one-way calls reach the service, they may not be dispatched all at once, and may be queued up on the service side to be dispatched one at a time, all according to the service’s configured concurrency mode behavior. (Chapter 8 will discuss concurrency management and one-way calls in depth.) How many messages (be it one-way operations or request-reply ones) the service is willing to queue up is a product of the configured channel and reliability mode. If the number of queued messages has exceeded the queue’s capacity then the client will block, even when issuing a one-way call. However, once the call is queued (which is usually the case), the client is unblocked and can continue executing, while the service processes the operation in the background. All the WCF bindings support one-way ...

Get Programming WCF Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.