| Options for Hosting a WCF Service: - Internet Information Server (IIS): WCF services can be hosted within Internet Information Services, which provides a number of advantages if the service uses HTTP as its transport protocol.
- Windows Activation Service: is the new process activation mechanism that is a feature of IIS 7.0. IIS 7.0 is a part of Microsoft Windows Vista and the newly released Microsoft Windows Server 2008.
- Self Hostd:WCF services can be hosted inside any .NET managed application, such as console applications and Windows Forms or Windows Presentation Foundation (WPF) graphical applications.
| [C#] ServiceHost myHost = new ServiceHost(typeof(MyService), baseAddress); myHost.Open(); //to start the service
| |
- Managed Windows Service:A WCF service can be registered as a Windows Service, so that it is under control of the Windows Service Control Manager (SCM).
This is suitable for long-running WCF services that are hosted outside of IIS in a secure environment and are not message- activated. To host a WCF service in this way, the application must be written as a Managed Windows Service by inheriting from System.ServiceProcess.ServiceBase It must also implement a WCF service contract interface and then create and open a ServiceHost to manage the WCF service. | |
No comments:
Post a Comment