访问net.tcp WCF操作合同时出错

时间:2012-01-26 15:54:14

标签: wcf iis-7 nettcpbinding

我有简单的WCF服务,我成功地在IIS 7下托管它。我也可以生成客户端(使用WCFTestClient.exe util),但是当我尝试运行Wcf方法时,我收到以下错误

  

无法调用该服务。可能的原因:服务离线或无法访问;客户端配置与代理不匹配;现有代理无效。有关更多详细信息,请参阅堆栈跟踪。您可以尝试通过启动新代理,还原到默认配置或刷新服务来恢复

我的服务是获取输入并以“您输入的内容:{0}”格式返回字符串。 这是我的web.config

<system.serviceModel>
<services>
  <service behaviorConfiguration="ServiceBehavior" name="II7WcfService.MyService">

    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost/artur/MyService" />
      </baseAddresses>
    </host>

    <endpoint address="net.tcp://localhost/artur/MyService"
              binding="netTcpBinding"
              bindingConfiguration="PortSharingBinding"
              contract="II7WcfService.IMyService" />

    <endpoint address="mex"
              binding="mexTcpBinding"
              contract="IMetadataExchange" />

  </service>
</services>
<bindings>
  <netTcpBinding>
    <binding name="PortSharingBinding" portSharingEnabled="true">
      <security mode="None"/>
    </binding>
  </netTcpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="True" />
    </behavior>
  </serviceBehaviors>
</behaviors>

0 个答案:

没有答案