This project is read-only.


Central to SOA on any Microsoft Platform is Microsoft Windows Communication Foundation (WCF). Windows Communication Foundation is an application programming interface in the .Net Framework for building connected, service-oriented applications. One of the challenges with leveraging WCF is choosing an appropriate mechanism for hosting WCF services. WCF Services are typically classes that are compiled into an assembly with a dll extension and, as a result , lack the ability to natively launch a process within which to execute. WCF Services therefore rely on a host to provide the Process and Application Domain within which the service will execute.

WCF Provides the following hosting options, each with its own pros and cons.
• WinForms applications
• Console applications
• Windows services
• Web applications (ASP.NET) hosted on Internet Information Services (IIS)
• WCF services inside IIS 7.0 and WAS on Windows Vista or Windows Server code name "Longhorn" (2008)

IIS, because of its request response architecture and because it was built from the ground up to be a Web Server, only supports http binding. It is also not an ideal solution for hosting services as singletons or for hosting services that have significant initialization overhead because it activates services only when it receives the first request. WAS overcomes most of these deficiencies but requires a Windows Vista based operating system. This leaves us with the so called “self-hosting” options that include WinForms applications, Console applications and Windows services. Since WinForms and Console applications do not allow for unattended execution, because a user must be logged into the system for these processes to execute, they are not a viable alternative. This leaves us with a Windows Service based approach to hosting as the only option.

Windows Services have the following advantages:
• Automatic starting: The Windows Service Control Manager allows you to set the startup type to automatic, so that as soon as Windows starts, the service will be started, without an interactive logon on the machine.
• Recovery: The Windows Service Control Manager has built-in support to restart services when failures occur.
• Security identity: The Windows Service Control Manager allows you to choose a specific security identity under which you want the service to run including built-in system or network service accounts.
• Manageability: In general, Windows operators know a lot about the Service Control Manager and other management tools that can work with Windows service installation and configuration. This will improve the acceptance of Windows services in production environments; however, to make services maintainable, you would probably have to add some instrumentation and logging features.
• Support for all bindings and transports: Self-hosting doesn't limit you in using any of the out-of-the-box bindings and transports whatsoever. On Windows XP and Windows Server 2003, IIS limits you to HTTP only.

A windows service, however, still have some significant limitations when it comes to support for high availability, easy manageability, versioning, and deployment. Essentially you have to cover these requirements yourself through custom code. It is also very inconvenient to develop a new Windows Service for every new WCF Service. This is especially a concern in a Service Bus which could potentially consist of many WCF Services. The Generic Service Host was developed to address these and other concerns.


.Net Framework 2.0/3.0/3.5

Enterprise Library May 2007 (Version 3.1)

Last edited Jan 28, 2011 at 3:37 AM by ekeratbellsouth, version 10


No comments yet.