Posts

Showing posts with the label WCF IIS 5/6 Hosting

WCF IIS 5/6 Hosting

Image
The main advantage of hosting service in IIS is that, it will automatically launch the host process when it gets the first client request. It uses the features of IIS such as process recycling, idle shutdown, process health monitoring and message based activation. The main disadvantage of using IIS is that, it will support only HTTP protocol. Let as do some hands on, to create service and host in IIS Step 1: Start the Visual Studio 2008 and click File->New->Web Site. Select the 'WCF Service' and Location as http. This will directly host the service in IIS and click OK. Step 2:  I have created sample HelloWorld service, which will accept name as input and return with 'Hello' and name. Interface and implementation of the Service is shown below. IMyService.cs [ServiceContract] public interface IMyService { [OperationContract] string HelloWorld(string name); } MyService.cs public class MyService : IMyService { #region IMyService Member...