Reliable Secure Profile
This sample demonstrates how to compose WCF and Reliable Secure Profile (RSP). This sample demonstrates the implementation of a Make Connection channel which can be composed together with Reliable Messaging and optionally a secure channel to create a Reliable Secure Binding based on the RSP specification.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.
If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.
This sample demonstrates a reliable asynchronous two-way message exchange scenario. The service has a duplex contract and the client implements the duplex callback contract. The client initiates a request to a service, for which a response is expected on a separate connection. The request message is sent reliably. The client does not want to open a listening endpoint at its end. Thus, it polls the service with ‘Make Connection’ requests for the service to send back the response on the back channel of this ‘Make Connection’ request. This sample demonstrates how to have secure reliable duplex communication over HTTP without the client exposing a listening endpoint (and creating a firewall exception).
To set up, build, and run the sample
Open the ReliableSecureProfile solution.
Right click the Service project in Solution Explorer, select Debug, Start new instance from the context menu. This starts up the service host.
Right click the Client project in Solution Explorer, select Debug, Start new instance from the context menu. This starts up the client.
Type in any string in the prompt on the client console window and click ENTER.This sends the input string to the service, which computes a hash of this string.
View the result on the client windows when the service calls back the duplex callback contract operation to display the result on the client console window. There is an intentional delay on the service to simulate a long running operation of processing the data.
Monitoring the HTTP traffic (by any of the online network monitoring tools like Network Monitor, Fiddler and so on) shows that a sequence for communication is established between the client and the service as laid down by the Reliable Secure Profile, and how the client polls the service with ‘Make Connection’ requests. When the service gets ready to send back the processed response, it uses the back channel of the last ‘Make Connection’ request to send back the results.
Press ENTER on the service console window to close the service. Press ENTER on the client console window to close the client.