Thursday, March 18, 2010

Hosting Options for WCF services


Hosting Options

a.    IIS 7 (WAS)
b.    Windows Service



Choosing a Hosting Environment
The following table summarizes some of the key benefits and scenarios associated with each of the hosting options.
Hosting Environment
Common Scenarios
Key Benefits and Limitations
Managed Application ("Self-Hosted")
·         Console applications used during development.
·         Rich WinForm and WPF client applications accessing services.
·         Flexible.
·         Easy to deploy.
·         Not an enterprise solution for services.
Windows Services (formerly known as NT services)
·         A long-running WCF service hosted outside of IIS.
·         Service process lifetime controlled by the operating system, not message-activated.
·         Supported by all versions of Windows.
·         Secure environment.
IIS 5.1, IIS 6.0
·         Running a WCF service side-by-side with ASP.NET content on the Internet using the HTTP protocol.
·         Process recycling.
·         Idle shutdown.
·         Process health monitoring.
·         Message-based activation.
·         HTTP only.
Windows Process Activation Service (WAS)
·         Running a WCF service without installing IIS on the Internet using various transport protocols.
·         IIS is not required.
·         Process recycling.
·         Idle shutdown.
·         Process health monitoring.
·         Message-based activation.
·         Works with HTTP, TCP, named pipes, and MSMQ.
IIS 7.0
·         Running a WCF service with ASP.NET content.
·         Running a WCF service on the Internet using various transport protocols.
·         WAS benefits.
·         Integrated with ASP.NET and IIS content.

The choice of a hosting environment depends on the version of Windows on which it is deployed, the transports it requires to send messages and the type of process and application domain recycling it requires. The following table summarizes the data related to these requirements.

Hosting Environment
Platform Availability
Transports Supported
Process and AppDomain Recycling
Managed Applications ("Self-Hosted")
Windows XP, Windows Server 2003, Windows Vista,
Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
No
Windows Services (formerly known as NT services)
Windows XP, Windows Server 2003, Windows Vista,
Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
No
IIS 5.1
Windows XP
HTTP
Yes
IIS 6.0
Windows Server 2003
HTTP
Yes
Windows Process Activation Service (WAS)
Windows Vista, Windows Server 2008
HTTP,
net.tcp,
net.pipe,
net.msmq
Yes

It is important to note that running a service or any extension from an untrusted host compromises security. Also, note that when opening a ServiceHost under impersonation, an application must ensure that the user is not logged off, for example by caching the WindowsIdentity of the user.

See Also



Hosting Options References :




No comments:

Post a Comment