在WinForms项目中添加对WCF项目的服务引用 - 错误TCP错误代码10061

时间:2012-11-16 20:17:15

标签: wcf

我有多个WCF项目,我试图在WinForms项目中引用它。当我尝试添加服务引用时,我可以看到几个项目,但是没有显示,并且拒绝让我添加它,即使我手动输入地址也是如此。当我这样做时,我得到:

元数据包含无法解析的引用:'net.tcp:// localhost:14007 / DispatchPuller / mex'。 无法连接到net.tcp:// localhost:14007 / DispatchPuller / mex。连接尝试持续时间跨度为00:00:01.0062012。 TCP错误代码10061:无法建立连接,因为目标计算机主动拒绝它127.0.0.1:14007。 无法建立连接,因为目标计算机主动拒绝了它127.0.0.1:14007

据我所知,所有服务的设置方式都是一样的。这是两个,它的顶部给了我错误:

<system.serviceModel>
    <services>
      <service name="PASWCFDispatchPuller.DispatchPuller" behaviorConfiguration="tcpbehaviuor">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="" name="nettcpDispatchPuller" contract="PASWCFDispatchPuller.IDispatchPuller">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="mexDispatchPuller" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:12007/DispatchPuller"/>
          </baseAddresses>
        </host>
      </service>

      <service name="PASWCFDispatchPuller.StateUpdate" behaviorConfiguration="tcpbehaviuor">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="" name="nettcpStateUpdate" contract="PASWCFDispatchPuller.IStateUpdate">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="mexStateUpdate" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:12007/StateUpdate"/>
          </baseAddresses>
        </host>
      </service>

    </services>
    <behaviors>
      <serviceBehaviors>
        <!--<behavior >-->
        <behavior name="tcpbehaviuor">
          <!-- To avoid disclosing metadata information, 
            set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="false"/>
          <!-- To receive exception details in faults for debugging purposes, 
            set the value below to true.  Set to false before deployment 
            to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

添加对底层服务的引用没有问题。更改顶部端口也没有任何作用。任何建议将不胜感激。

0 个答案:

没有答案