简体   繁体   English

WCF Web服务引发EndPointNotFoundException

[英]WCF Web service is throwing EndPointNotFoundException

I am trying to configure a WCF service to support duplex communication to a client service and since I switched to WSDualHttpBinding I now get this on the service in IIS 我正在尝试配置WCF服务以支持与客户端服务的双工通信,并且由于我切换到WSDualHttpBinding,因此现在可以在IIS中的服务上获取它

There was no endpoint listening at http://exampple.com/Temporary_Listen_Addresses/06be1668-e09f-441c-9fc9-999e4922d4a8/1002945c-979b-484e-a2c5-fa3470b6706d that could accept the message. http://exampple.com/Temporary_Listen_Addresses/06be1668-e09f-441c-9fc9-999e4922d4a8/1002945c-979b-484e-a2c5-fa3470b6706d上没有侦听终结点的端点。 This is often caused by an incorrect address or SOAP action. 这通常是由不正确的地址或SOAP操作引起的。 See InnerException, if present, for more details. 有关更多详细信息,请参见InnerException(如果存在)。 The inner exception is null and basically the service on the server is hosted in IIS then I have a self hosted service on the client machine that connects to the server and a client application that connects to the self hosted service. 内部异常为null,并且基本上服务器上的服务托管在IIS中,然后我在连接到服务器的客户端计算机上有一个自托管服务,而连接到自托管服务的客户端应用程序上有一个自托管服务。 The wsDualHttpbinding is from the server to the self hosted service and the self hosted service exposes a named pipe for the client application to communicate with. wsDualHttpbinding从服务器到自托管服务,自托管服务公开了一个命名管道,供客户端应用程序与之通信。

Here is the Web.config from the service: 这是该服务中的Web.config:

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <protocolMapping>
      <remove scheme="http" />
      <add scheme="http" binding="wsDualHttpBinding" />
    </protocolMapping>
    <bindings>
      <wsDualHttpBinding>
        <binding name="WsDualHttp_EcuWebBinding" />
      </wsDualHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="EcuWebServiceBehavior" name="EcuWeb.Service.EcuWebService">
        <endpoint address="/EcuWebService.svc" binding="wsDualHttpBinding" bindingConfiguration="WsDualHttp_EcuWebBinding" name="WsDualHttp_EcuWeb" contract="EcuWeb.Service.IEcuWebService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="EcuWebServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="1" multipleSiteBindingsEnabled="true">
    <serviceActivations>
      <add relativeAddress="EcuWebService.svc" service="EcuWeb.Service.EcuWebService" />
    </serviceActivations>
  </serviceHostingEnvironment>
  </system.serviceModel>
</configuration>

Here is the App.config from my host application: 这是我的主机应用程序中的App.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <client>
            <endpoint address="http://localhost:51334/EcuWebService.svc/EcuWebService.svc" binding="wsDualHttpBinding" bindingConfiguration="WsDualHttp_EcuWeb" contract="EcuWebService.IEcuWebService" name="WsDualHttp_EcuWeb">
                <identity>
                    <userPrincipalName value="myusername@domain.com" />
                </identity>
            </endpoint>
        </client>
        <behaviors>
            <serviceBehaviors>
                <behavior name="NetNamedPipeBehavior_EcuService">
                    <serviceDebug includeExceptionDetailInFaults="true" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <bindings>
            <netNamedPipeBinding>
                <binding name="NetNamedPipedBinding_EcuService" />
            </netNamedPipeBinding>
            <wsDualHttpBinding>
                <binding name="WsDualHttp_EcuWeb" />
            </wsDualHttpBinding>
        </bindings>
        <services>
            <service behaviorConfiguration="NetNamedPipeBehavior_EcuService"
                name="Ecu.Services.EcuService">
                <endpoint address="net.pipe://localhost/EcuNamedPipe" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipedBinding_EcuService" name="NetNamedPipeBinding_IEcuService" contract="Ecu.Services.IEcuService" />
            </service>
        </services>
    </system.serviceModel>
</configuration>

And finally the App.config from the client test application: 最后是来自客户端测试应用程序的App.config:

<?xml version="1.0"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    <system.serviceModel>
        <bindings>
            <netNamedPipeBinding>
                <binding name="NetNamedPipeBinding_IEcuService" />
            </netNamedPipeBinding>
        </bindings>
        <client>
            <endpoint address="net.pipe://localhost/EcuNamedPipe" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IEcuService" contract="EcuServiceClient.IEcuService" name="NetNamedPipeBinding_IEcuService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

I have gotten this fixed thanks to another post on SO that pointed me to this article about WCF Duplex services. 感谢SO上的另一篇文章使我获得了有关WCF Duplex服务的这篇文章的信息,此问题已经得到修复。 Duplex Article 双面文章

Once I switched over to net.tcp and got everything setup to use it the duplex communication worked no problem. 一旦我切换到net.tcp并进行了所有设置以使用它,双工通信就没有问题了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM