WCF as part of the .NET Framework supports different OS platforms, providing accessibility over many protocols including HTTP, TCP, IPC and MSMQ.
But not every WCF host support the entire suite of protocols which limiting your options at times. Beyond this fact, other features available to the hosting environment also influence deployment decisions and choice of host. In this article, I’ll provide you with an overview of WCF hosting options and their availability, helping you to choose the right scenarios for your service.
One of the most important features IIS provides your WCF services is message-based activation which means that ServiceHost instances need not be open prior to processing requests for a given endpoint. Another great option is ASP.NET compatibility (binding HttpContext in your service) which is available for providing support on using Session, Cache or Profile objects.
If you have IIS 5.0 or 6.0, main limitation on this host option, is the usage on bindings over HTTP. If you need TCP, MSMQ or named pipes, then WAS or Windows service is your option.
IIS 7.0 option takes care on the same things as previous versions on IIS when we are talking about HTTP based bindings.
Unfortunately, WAS and IIS7.0 option is only available on Vista and Windows Server 2008 machines.
Choosing Windows service as a host provides you support transports such as TCP, MSMQ and named pipes if you don’t have IIS 7.0 yet. Pros on Windows services over other self-hosting variants is the benefit of managed service lifetime: automatic startup controlled by the OS, running with least privileged account, restart on failures.
The drawback of using a Windows service compared to IIS is that Windows services have limited features to support availability, manageability, and deployment, so you will have to write custom code to support these features.
Other self-hosting options should be used only for development and demonstration purposes because it is not suitable for a production scenario – closing the application means closing on the service host. There is no option for controlling the host by the OS, no direct support for running under least-privileged account and not option for automatic recovery. Flexibility for using any transport helps you to setup. Compared to IIS5.0 and IIS6.0 provides support on all supported transport.
But not every WCF host support the entire suite of protocols which limiting your options at times. Beyond this fact, other features available to the hosting environment also influence deployment decisions and choice of host. In this article, I’ll provide you with an overview of WCF hosting options and their availability, helping you to choose the right scenarios for your service.
Internet Information Services (IIS)
IIS is good as a host on WCF service in cases when the transport is supported by the certain version of the server. Features available in IIS such as recycling, idle shutdown, health monitoring and message based security are great to be included in your service – efficient service management and scalability.One of the most important features IIS provides your WCF services is message-based activation which means that ServiceHost instances need not be open prior to processing requests for a given endpoint. Another great option is ASP.NET compatibility (binding HttpContext in your service) which is available for providing support on using Session, Cache or Profile objects.
If you have IIS 5.0 or 6.0, main limitation on this host option, is the usage on bindings over HTTP. If you need TCP, MSMQ or named pipes, then WAS or Windows service is your option.
IIS 7.0 option takes care on the same things as previous versions on IIS when we are talking about HTTP based bindings.
WAS
WAS is a process activation service installed with IIS 7.0 that decouples the activation architecture from IIS in order to support non-HTTP protocols such as named pipes, TCP, and MSMQ. Like IIS 6.0, WAS also provides features for idle-time management, health monitoring, process recycling and management tools for configuring application pools among other things.Unfortunately, WAS and IIS7.0 option is only available on Vista and Windows Server 2008 machines.
Self-Hosting
The term “self-hosting” refers to any application that provides its own code to initialize the hosting environment. This includes Console, Windows Forms, WPF, and managed Windows services - which are the most useful option for the self-hosting environments for WCF services.Choosing Windows service as a host provides you support transports such as TCP, MSMQ and named pipes if you don’t have IIS 7.0 yet. Pros on Windows services over other self-hosting variants is the benefit of managed service lifetime: automatic startup controlled by the OS, running with least privileged account, restart on failures.
The drawback of using a Windows service compared to IIS is that Windows services have limited features to support availability, manageability, and deployment, so you will have to write custom code to support these features.
Other self-hosting options should be used only for development and demonstration purposes because it is not suitable for a production scenario – closing the application means closing on the service host. There is no option for controlling the host by the OS, no direct support for running under least-privileged account and not option for automatic recovery. Flexibility for using any transport helps you to setup. Compared to IIS5.0 and IIS6.0 provides support on all supported transport.
Comments
Post a Comment