문제

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

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. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. 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. 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.

Here is the Web.config from the service:

<?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:

<?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:

<?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. Duplex Article

Once I switched over to net.tcp and got everything setup to use it the duplex communication worked no problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top