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

半城伤御伤魂 提交于 2019-12-22 07:05:10

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/7181011/host-wcf-service-with-net-tcp-binding-through-iis-manager-7-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!