This is the first example project in this series and forms the foundation of the other example projects--each of which builds off of this one in an attempt to make each example easy to understand. This is a complete example of WCF using OO principles that leverage the ServiceKnowType attribute. This example goes along with the content found here [0]. The zip file contains the following projects:
- Domain: A project that houses the domain objects of the application. The domain objects are used in both the client code and the WCF service.
- Interfaces: Where the WCF service interface sits. This is located in its own, separate project so that the server and client code can both access it (rather than forcing the client to build a proxy beforehand).
- WcfClient: The client console application that calls into the WCF service.
- WcfService: The WCF service project.
- WcfServiceHost: The console application that bootstraps the WcfService.
ExampleOne.zip [0]
You should be able to download the zip file, unzip it, open up the solution, and build it without a problem. To test the application, set the WcfServiceHost as the startup project and run, and then set the WcfClient project to the startup project before running.