【问题标题】:WCF with netTCPBinding带有 netTCPBinding 的 WCF
【发布时间】:2011-07-23 14:38:39
【问题描述】:

我写过 wcf 服务 当我将它部署在带有 http 绑定的 IIS7 上时,一切正常。

我想使用 netcp 绑定在 Windows Process Activation Services (WAS) 上部署相同的内容。 当我尝试使用 svcutil 为服务创建代理时 我收到以下错误消息: 错误:无法从 net.tcp://localhost/myservice/servi 获取元数据 服务端 如果这是您有权访问的 Windows (R) Communication Foundation 服务 ss,请检查您是否在指定的地址启用了元数据发布 埃斯。有关启用元数据发布的帮助,请参阅 MSDN 文档 离子在http://go.microsoft.com/fwlink/?LinkId=65455

WS-元数据交换错误 URI:net.tcp://localhost/servicemodelsamples/service.svc 元数据包含无法解析的引用:'net.tcp://localhost/ servicemodelsamples/service.svc'。

这里是 web.config:

<system.serviceModel>
    <services>
      <service name="MyProj.Myservice"behaviorConfiguration="CalculatorServiceBehavior">
        <!--This endpoint is exposed at the base address provided by host: net.tcp://localhost/servicemodelsamples/service.svc -->
        <endpoint binding="netTcpBinding" bindingConfiguration="PortSharingBinding"contract="MyProj.ICalculator"  />
        <!--the mex endpoint is explosed at net.tcp://localhost/servicemodelsamples/service.svc/mex -->
        <endpoint address="mex"binding="mexTcpBinding"contract="IMetadataExchange"  />
      </service>       
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="PortSharingBinding" portSharingEnabled="true">
          <security mode="None"  />
        </binding>             
      </netTcpBinding>
    </bindings>
    <!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
    <behaviors>
      <serviceBehaviors>
        <behavior name="CalculatorServiceBehavior">
          <serviceMetadata  />
          <serviceDebug includeExceptionDetailInFaults="False"  />
        </behavior>                   
      </serviceBehaviors>
    </behaviors>

谢谢,

【问题讨论】:

  • 您似乎使用localhost 作为您绑定的服务地址 - 您可以尝试使用机器名称或 IP 地址吗?这有什么区别吗??

标签: wcf nettcpbinding


【解决方案1】:

在 .net 4 上检查“Net.Tcp Listener Adapter”服务是否使用 .net 4 版本的 SMSvcHost.exe(应为 ...\v4.0.30319\SMSvcHost.exe) 如果不修复 .net 4 的安装

【讨论】:

    猜你喜欢
    • 2010-11-20
    • 2015-02-04
    • 2011-12-05
    • 1970-01-01
    • 2010-10-08
    • 2011-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多