Configuring Default Endpoints

When programming with WCF, we will often need to create some simple WCF services for testing our ServiceContracts. These services often use very simple and typical endpoint and binding definitions. However, every time we need to set up such a service, we have to define the same endpoint and binding settings again and again, which really adds much duplicated work. Fortunately, WCF 4.0 introduces the Default Endpoint feature which saves us from defining common endpoint/binding settings repeatedly.

How to do it...

The steps for using a default endpoint are quite straightforward:

  1. Create a new Console Application project in Visual Studio 2010 targeting .NET Framework 4.0.
  2. Add the ServiceContract in the service project and ...

Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications 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.