无法分派消息,因为端点地址net.tcp:// localhost /上的服务不可用于地址协议

时间:2013-09-25 05:27:58

标签: c# asp.net wcf

我正在Visual Studio 2012中开发WCF服务。以下是web.config文件:

  <system.serviceModel>
    <client>
      <endpoint address="net.tcp://localhost/BlueYonder/Booking" binding="netTcpBinding" contract="BlueYonder.BookingService.Contracts.IBookingService" name="BookingTcp">
        <identity>
          <certificateReference storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySubjectName" findValue="Server"/>
        </identity>
      </endpoint>
    </client>
    <bindings>
      <netTcpBinding>
        <binding>
          <security mode="Message">
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <clientCredentials>
            <serviceCertificate>
              <authentication revocationMode="NoCheck" />
            </serviceCertificate>
            <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="Client"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

我还在IIS中启用了net.tcp绑定。另外,我已经检查了所需的服务(监听器)正在运行。

但是,我收到以下错误消息:

EndPointNotFoundException

net.tcp:// localhost / BlueYonder / Booking中没有可以接受该消息的端点。这通常是由错误的地址或SOAP操作引起的。有关详细信息,请参阅InnerException(如果存在)。

1 个答案:

答案 0 :(得分:1)

您可以一步一步地尝试几件事

  1. 确保所有必需的服务都在运行。转到本地服务并检查以下服务。 看图像1
  2. 正如您所说,您已经在IIS中启用了net.tcp绑定,因此它很好。 3.确保您的HTTP端口和NET.TCP端口不同,最好是80位的http和808位的.NET.TCP。
  3. 重新启动IIS并在客户端应用程序中更新服务引用。
  4. 检查是否为NET.TCP添加了新服务请求而不是使用新服务,删除您已创建的旧服务。
  5. 确保您执行第4点和第5点(如果您已经完成了第1点到第3点) 如果您仍然遇到问题,请检查您的IIS是否注册了ASP.NET 4.5或您正在使用的任何其他版本。注册Asp.net for IIS的命令是aspnet_regiis -i。  以管理员身份运行Visual Studio developper命令提示符,然后启动C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i

相关问题