2013-02-08 128 views
1

我想配置一個WCF服務,支持全雙工通信的客戶服務,因爲我切換到WSDualHttpBinding我現在在IIS中得到這樣的服務WCF Web服務是扔EndPointNotFoundException

有沒有終點聽取http://exampple.com/Temporary_Listen_Addresses/06be1668-e09f-441c-9fc9-999e4922d4a8/1002945c-979b-484e-a2c5-fa3470b6706d可以接受該消息。這通常是由不正確的地址或SOAP操作引起的。有關更多詳細信息,請參閱InnerException(如果存在)。內部異常爲空,基本上服務器上的服務託管在IIS中,然後我在連接到服務器的客戶機和連接到自託管服務的客戶機應用程序上擁有自託管服務。 wsDualHttp綁定是從服務器到自託管服務的,而自託管服務公開了一個命名管道供客戶端應用程序進行通信。

這裏是從服務的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> 

這裏是我的主機應用程序的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="[email protected]" /> 
       </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> 

最後的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> 
+1

我明白了你的意思,以節省外部pastebin上的空間發佈,但月份會通過,外部資源發佈的代碼可能會消失,這會使你的問題(和可能的答案)變得毫無意義。 – abatishchev 2013-02-08 21:57:18

+0

我試着把它放在代碼標籤中,它只顯示第一行而不是整個配置。這是我使用pastebin的唯一原因。感謝您修復它。 – twreid 2013-02-08 21:58:36

+0

使用4個空格打算格式化代碼,非常簡單:) – abatishchev 2013-02-08 21:59:26

回答

0

我已經得到了這個固定感謝SO上的另一篇文章,它指出了我關於WCF Duplex服務的這篇文章。 Duplex Article

一旦我切換到net.tcp並獲得了一切設置使用它的雙工通信沒有問題。