Hosting the WCF service in IIS
The WCF service is now hosted within the WCF Service Host. To test it with our own test client, we will have to start WCF Service Host before we run our own test client. To make things easier, in this section, we will first decouple our WCF service from Visual Studio. We will host it in IIS.
You can follow these steps to host this WCF service in IIS (refer to the Hosting the service in IIS using the HTTP protocol section in Chapter 2, Hosting the HelloWorld WCF Service).
In the Solution Explorer, under the NorthwindService project, copy the
App.config
file toWeb.config
.Within the
Web.config
file, add the following node as a child node of the service model node,system.serviceModel
:<serviceHostingEnvironment > <serviceActivations> <add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./ProductService.svc" service="NorthwindService.ProductService"/> </serviceActivations> </serviceHostingEnvironment...