Once you’re ready to deploy your RESTful service using WCF, you’ll need to make a decision faced by every WCF service developer: where to host your service. The decision-making process should revolve around the capabilities that different hosting options can provide your endpoint. Those capabilities include process lifetime, process token, and security management, as well as general process management capabilities. In this chapter, we’ll examine the issues around hosting WCF services in your own process, which is known as self-hosting. We’ll also look at managed hosting, the name used to describe hosting WCF services inside of Internet Information Server (IIS).
Hosting a WCF service involves loading and running endpoints inside of an executable process. Because WCF is a CLR-based technology, you can host your endpoint inside of any executable process that can load the CLR. The main options are Windows Services, Windowed applications (like Windows Forms or Windows Presentation Foundation), or IIS.
WCF processes messages through a construct known as an endpoint. To
start a WCF endpoint in a particular process, you must create a
channel listener. Although there are a few ways to do this,
by far the most common is to rely on the
class to provide the infrastructure for loading up and starting
channel listeners for endpoints configured on the
An important thing to keep in mind when ...