Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

7.2. Default Binding, Behaviors, and Endpoints

In our previous example, we set a base address for our service to listen to (http://localhost:8888/Chapter7) with the following code, but we didn't actually create any endpoints:

ServiceHost MyServiceHost =
 new ServiceHost(typeof(Chapter7.ConfiglessService.Service1),
         new Uri("http://localhost:8888/Chapter7"));

In WCF4, if you don't specify any endpoints in code or by configuration, then WCF will automatically create a default endpoint for your service (one for each interface your service implements).

The type of endpoint that gets created is dependent on what you use as the base address. In this case, a basicHttpBinding was created, as we used an address starting with http://. However, if the address ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book