Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Host WCF service with net.tcp binding through IIS Manager 7.5

I am fairly new to hosting web applications and web services. Though I was successful in hosting a web application, I am running into road block after road block when trying to host a WCF service with net.tcp binding.

My scenario is as follows, I have a hosted web application that needs to communicate with a hosted WCF service with net.tcp binding through IIS 7.5. As stated the web application is hosted fine and I can browse the web site. However, the web application makes services calls to the WCF service and I am getting the 'TCP error code 10061' message which I believe is due to my hosted WCF service not running. I think this is not running because I attempt to 'telnet localhost 808' to see if the WCF service is running and it is not. I've run through numerous online guides and I still have had no luck. I believe I may be doing something fundamentally wrong with me being a noob and all. I am able to host the service through VS2010 and run the web application and it works fine so I believe my bindings are correct. I've also enabled tcp protocols on both websites in IIS Manager.

So I guess my real question is what are the IIS Manager steps needed to host a WCF service with net.tcp binding? It appears to me that it is not possible to host a net.tcp service through IIS Manager by simply creating a website because IIS Manager wants to bind to an http port.

like image 559
David Avatar asked Aug 24 '11 19:08

David


People also ask

How add TCP net binding in IIS?

Open IIS=> in Connections panel=> expand Sites=>Select your website=>Go to Right site Action Pane=> click on Advanced Settings=> Expand the 'Behavior' section In the field 'Enable Protocols' set these below values by commas, (http,net. tcp,net.

What is Net TCP binding WCF?

This binding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.

Which IIS version supports hosting of WCF service in Windows Activation Service?

WCF services can run in the same AppDomain/Application Pool/Worker Process as other applications when hosted by IIS 6.0 on Windows Server 2003.


2 Answers

Here are some things to check:

  • Ensure the Net.Tcp Listener Adapter windows service is running
  • Ensure netTcp is listed as an enabled protocol for your website (In IIS Manager, go to Advanced settings for your site)
  • Ensure netTcp is listed as an enabled protocol for application (directory) that is hosting your services (In IIS Manager, go to the directory hosting your services and select Advanced Settings)
  • Ensure your IIS site has a binding for net.tcp, with the correct port number listed.

EDIT:
See the following MSDN page for enabling/using non-HTTP bindings in .Net 4 + IIS 7/7.5:

Configuring the Windows Process Activation Service for Use with Windows Communication Foundation

like image 142
chris.house.00 Avatar answered Sep 22 '22 13:09

chris.house.00


And I discovered that for me it didn't work to use localhost... You should use 127.0.0.1 or the name of your computer.

like image 27
Mattias Almén Avatar answered Sep 19 '22 13:09

Mattias Almén