static void

WCF Hosts and Endpoints

Service Hosts

In svc:

<%@ ServiceHost Service="Service1" %>

In code:

//or WebServiceHost for web
var host = new ServiceHost(
    //or pass new MyService() for singleton
    typeof(MyService),
    //params or array of base addresses
    new Uri("http://localhost:8000/"));
host.AddServiceEndpoint(
    typeof(IMyService),
    new WebHttpBinding(),
    //baseAddress + service name = full url.
    //If no base address, can use full address here.
    "MyService");

Hosts

Endpoints

Metadata