Hosting Your WCF Service

In this article I have covered multiple hosting for a web based client and Windows based client by using a Fault Contract and database connectivity. Many WCF developers do not understand the difference between TCP Binding and Http Binding, how it is configured at the IIS level and at the web configuration architecture level.

You need to use the following procedure before hosting multiple end points.

Step 1

First you need to edit the bindings, right-click in your default web site and click "Edit".

Bindings

WCF1.jpg

Now set the Net.tcp binding by just clicking the "Add" button and set the binding port.

Windows 7 has around the 16000 ports. Nearly 8000 of them are free to be used.

You will also get how many types of bindings are hosted in IIS7.0+.

WCF2.jpg

Step 2

IIS 7.0 by default only provides the single Http protocol. Now we need to add the tcp.net protocol in a comma separated list. Please use a comma and spell tcp.net properly otherwise the service will not work properly.

Open IIS then click on "Service" - > "Advanced Settings".

WCF3.jpg

Step 3

Please ensure that the TCP service status is started in Services otherwise the TCP service will not work properly.

Open "Control Panel" -> "All Control Panel Items" - > "Administrative Tools" -> "Services".

WCF4.jpg
 


Similar Articles