For more information about how WCF and ASP.NET interact, see WCF Services and ASP.NET. For more information about configuring security, see Windows Communication Foundation Security.
For the source copy of this example, see IIS Hosting Using Inline Code.
To create a service hosted by IIS
- Confirm that IIS is installed and running on your computer. For more information about installing and configuring IIS see Installing and Configuring IIS 7.0
- Create a new folder for your application files called "IISHostedCalcService", ensure that ASP.NET has access to the contents of the folder, and use the IIS management tool to create a new IIS application that is physically located in this application directory. When creating an alias for the application directory use "IISHostedCalc".
- Create a new file named "service.svc" in the application directory. Edit this file by adding the following @ServiceHost element.
See full details: http://msdn.microsoft.com/en-us/library/ms733766.aspx