This sample demonstrates how to use the messaging activities (Receive and SendReply) in the designer with content-based correlation based on a parameter in the message. In this scenario, the operations of the calculator are in a parallel convoy. Both an instance and a correlation (based on
CalculatorId) are created when the first message is sent to the workflow, and subsequent messages with the same
CalculatorId are dispatched to that instance until the Reset operation is called. The client is implemented as a WPF application that uses a code-based client proxy to communicate with the service.
To use this sample
Start Visual Studio 2010 in elevated permissions, open the For.sln solution file.
Navigate to the folder that contains Visual Studio 2010.
Right-click Devenv.exe and select Run as administrator.
Using Visual Studio 2010, open the CorrelatedCalculator.sln solution file.
To build the solution, press CTRL+SHIFT+B.
To run the service project, press CTRL+F5.
Once the service is ready and listening for messages, in Solution Explorer, right-click the Client project and run it.
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.