5

我对托管 Web 应用程序和 Web 服务还很陌生。尽管我成功地托管了一个 Web 应用程序,但在尝试托管具有 net.tcp 绑定的 WCF 服务时,我遇到了一个又一个的障碍。

我的场景如下,我有一个托管的 Web 应用程序,它需要通过 IIS 7.5 与带有 net.tcp 绑定的托管 WCF 服务进行通信。如前所述,Web 应用程序托管良好,我可以浏览该网站。但是,Web 应用程序对 WCF 服务进行服务调用,并且我收到“TCP 错误代码 10061”消息,我认为这是由于我的托管 WCF 服务未运行。我认为这没有运行,因为我尝试“telnet localhost 808”以查看 WCF 服务是否正在运行,但它没有运行。我浏览了许多在线指南,但仍然没有运气。我相信我可能是在做一些根本错误的事情,因为我是一个菜鸟。我能够通过 VS2010 托管服务并运行 Web 应用程序,它工作正常,所以我相信我的绑定是正确的。我'

所以我想我真正的问题是托管具有 net.tcp 绑定的 WCF 服务所需的 IIS 管理器步骤是什么?在我看来,不可能通过简单地创建一个网站来通过 IIS 管理器托管 net.tcp 服务,因为 IIS 管理器想要绑定到一个 http 端口。

4

2 回答 2

4

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

于 2011-08-24T19:53:14.180 回答
1

而且我发现对我来说,使用 localhost 是行不通的……您应该使用 127.0.0.1 或您的计算机名称。

于 2011-10-09T19:14:43.253 回答