【问题标题】:IIS 7.5 / WCF - net.tcp status unknownIIS 7.5 / WCF - net.tcp 状态未知
【发布时间】:2012-05-24 19:15:28
【问题描述】:

我正在尝试让我的 WCF 服务使用 netTcpBinding 而不是 wsHttpBinding,但我似乎无法让它工作。

我将net.tcp 绑定添加到 IIS7.5,但状态为未知(当我还删除 http 绑定时,它会在站点中放置一个大红色 X,我必须先添加一个新的 http 绑定我可以再次访问任何设置)。我已经看过这里和谷歌,但我只能找到两三个关于这个问题的帖子,没有任何真正的解决方案。

我有什么:

  • WAS 服务正在运行,还有 Net.* 服务。
  • 在 IIS 的高级设置中添加了 net.tcp。
  • 已安装 WCF 非 http。

似乎有一个 TCP 侦听器正在运行,因为它在 netstat 中显示它正在侦听我指定的端口:809)并且我还收到了防火墙消息(也尝试禁用防火墙/防病毒,但它没有'帮助)。

WCF 测试客户端导致此错误:

错误:无法从 net.tcp://localhost:809/MyService.svc 获取元数据

我的 Web.config(主要从 MSDN 复制,正确的布局请看这里http://pastebin.com/Ru8p0T9N):

<services>
  <service behaviorConfiguration="MyBehavior" name="WCFService.MyService">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="Binding1" name="MyServiceEndpoint" contract="WCFService.MyService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MyServiceMexTcpBidingEndpoint" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:809/MyService.svc" />
      </baseAddresses>
    </host>
  </service>
</services>
<behavior name="MyBehavior">
  <serviceMetadata httpGetEnabled="false" />
  <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<netTcpBinding>
  <binding name="Binding1"hostNameComparisonMode="StrongWildcard"sendTimeout="00:10:00"maxReceivedMessageSize="65536"transferMode="Buffered"portSharingEnabled="true">
    <security mode="Message">
      <transport clientCredentialType="None" />
      <message clientCredentialType="None" />
    </security>
  </binding>
</netTcpBinding> 

wsHttpBinding 一切正常,但net.tcp 不行。我在多个来源的 Web.config 中尝试了几种不同的设置,但最终还是遇到了同样的问题。

【问题讨论】:

  • 您是否验证了以下文章中的所有问题:codegain.com/articles/wcf/howto/…
  • 感谢您的链接,我将应用程序池设置为经典模式(之前没有),但仍然是同样的错误。

标签: c# wcf iis service net.tcp


【解决方案1】:

您是否将 net.tcp 添加为 IIS 中的启用协议?管理网站 => 高级设置 => 启用协议(逗号分隔)

【讨论】:

  • 是的,我做到了(另请参阅第一篇文章);)我将其作为 http,net.tcp,如 MSDN 上所述。
【解决方案2】:

对于有同样问题的人:正如我之前所说,我将应用程序池更改为 Classic 并且它不起作用(http 也不再起作用),但是当我将它改回来并回收应用程序池时它突然工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-14
    • 2017-01-14
    • 1970-01-01
    相关资源
    最近更新 更多