Request answering (request-reply), one-way operation (one-way), callback operation (call back)
In addition to supporting classic request response (request-reply) mode, WCF provides an operational invocation pattern, how they differ, and how we use these operations to invoke patterns in development. This article in this section will be introduced in detail today. WCF distributed development steps to Win (10): Request answering (request-reply), one-way operation (one-way), callback operation (call back). This article structure: "1" request answering (request-reply), "2" one-way operation (one-way) , "3" callback operation (call back), "4" Sample Code Analysis, "5" summary. Finally upload the sample code for this article.
In addition to supporting classic request/Answer mode surprises, WCF also provides support for one-way operations, bidirectional callback modes of operation, as well as streaming operations (the latter is similar to the optimized transport mechanism provided by WSE3.0, which I have explained in this article WSE3.0 Building Web Services Security (4): MTOM message transfer optimization and file upload, download). Today we'll look at the concepts, differences, implementation mechanisms, and how to implement them in code, and the details to be noted at the end of this article.
"1" Request answering (request-reply):
The request response mode is the default operating mode. This is similar to the classic C/s programming, the client sends a request, blocks the client process, and the server returns the result of the operation. Request response mode and binding correspondence:
In addition to netpeertcpbinding and netmsmqbinding bindings, all bindings support request-reply operations.
"2" one-way operation (one-way):
"2.1" Concept:
In simple terms, the one-way operation does not return a value, the client simply calls, regardless of the result. One-way operation once the client makes a request, WCF generates a request and does not return any messages to the client. A one-way operation differs from an asynchronous operation, although a one-way operation blocks the client only at the instant of the call, but if multiple one-way invocations are issued, WCF puts the request call into the queue and executes at some point. The number of queue store calls is limited, and once the number of calls that are made exceeds the set value of the queue store call, a blocking behavior occurs because the call cannot be placed in the queue. When the queue's request is out, the blocking call is placed in the queue and the client is unblocked. binding protocols and one-way request mode relationships:
differs from the request response mode. All WCF-bound communication protocols support one-way operations.