Friday, September 10, 2010

What is procedure to host WCF webservices

WCF is a flagship product from Microsoft for developing distributed application using SOA. Prior to WCF traditional ASMX Web services were hosted only on Internet Information Services (IIS). The hosting options for WCF services are significantly enhanced from Microsoft .NET Framework 3.0 onwards. In WCF there are three main parts: Service, Endpoints and Hosting Environment. Multiple services can be hosted using a single host process and also the same service type can be hosted in multiple host processes. We can host a WCF service in two ways - Self Hosting and IIS Hosting. Here we will examine Self Hosting along with a comparative discussion of different hosting environments.

elf Hosting Vs IIS Hosting

Let’s look at  the differences between the two hosting types
available for a WCF service.


IIS Hosting

Needs to add code to host the process

Automatic hosting

Host process should be running before client makes a call to the


IIS host runs automatically when a client makes a call to the


Automatic process recycling not possible

Automatic process recycling not possible

Can   controlled the service lifetime using Open and Close methods

Lifetime cannot be controlled manually.

Easy to deploy

More difficult deployment than  Self-Hosting


Protocols Supported


http, wshttp



console and form application






Steps to host WCF services

This is the Procedure to host and publish your Website : 1-Change the EndPoints in ServiceReferences.ClientConfig and any where there are Endpoints to
2-Right Click Project.Web and then select (Publish) :
a-Publish method :FTP
b-Target Location :any Folder(X)

3-When you have Images and ect.. you should all put in ClientBin in your (X) Folder

4-Configure your IIS >> Add the MIME types Like this >>>

5-Add your Publish Folder to C:\Inetpub\wwwroot

6 >>

1. Open IIS
2. Expand Sites
3. Right click on Default Web Page and select "Add New Virtual Directory" option
4. In the opened pop-up window input "Alias" as Test and populate "Physical path" with C:\Inetpub\wwwroot\TestApp and click "OK"
5. Right click on the created virtual directory (Test) and select "Convert To Application" option from the content menu.
6. In the opened pop-up window make sure you have selected by clicking the "Select..." button Classic .NET AppPool in "Application pool". Click "OK".

7-Copy the clientAccessPolicy.xml and crossDomain.xml to your C:\Inetpub\wwwroot folder.


b-crossDomain.xml :

8-In your Sql Server , Give IIS Users Permissions to Access your Database.

Solution by:

Rajesh Rolen

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates