the core object of hosting service is ServiceHost,we can use the following code to instantiate a ServiceHost:
using (ServiceHost host = new ServiceHost(typeof(MyService)))
{
host.Open();
Console.Read();
}
the main purpose of this instance is to create ServiceDescription,the SericeHost and the ServiceDescription are the top 2 important object for the ServiceHost
after Opening serviceHost,many operations are done in the background automatically.
- validate serviceDescription
- group the endpoint according to the ListenUri and ListenUriMode
- Create ChannelDispatcher
- Create EndpointDispatcher
- Dispatch Behavior
a little map
转载于:https://www.cnblogs.com/sanjia/archive/2011/03/10/wcf_servicehost.html