0

WCF Duplex not working under Azure. Everything works fine under IIS Express. I know duplex binding is problematic because of the server callback, but.... I already shut down my firewall. TCPView (Sysinternals) shows 10 to 12 packets being sent/received by the client and then it just dies... nothing happens. I set to 10 minutes all timeouts i could.

Please see my config files below.

SERVER CONFIG:

  <system.serviceModel>
<services>
  <service behaviorConfiguration="MexBehaviour" name="MySrvc">
    <endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBinding"
      name="wsDualEndpoint" bindingName="wsDualHttpBinding" contract="IMySrvc" />
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="mexHttpBinding"
      name="MexEndpoint" bindingName="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://srvc.azurewebsites.net/MySrvc.svc" />
      </baseAddresses>
      <timeouts openTimeout="00:10:00" />
    </host>
  </service>
</services>
<bindings>
  <wsDualHttpBinding>
    <binding name="wsDualHttpBinding" openTimeout="00:10:00" sendTimeout="00:10:00"
      clientBaseAddress="http://xxx.xxx.xxx.xxx:xxx">
      <security mode="None">
        <message clientCredentialType="None" negotiateServiceCredential="false" />
      </security>
    </binding>
  </wsDualHttpBinding>
  <mexHttpBinding>
    <binding name="mexHttpBinding" />
  </mexHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="MexBehaviour">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
    <add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>    
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

CLIENT CONFIG:

    <system.serviceModel>
    <bindings>
        <wsDualHttpBinding>
            <binding name="wsDualEndpoint">
                <security mode="None" />
            </binding>
        </wsDualHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://srvc.azurewebsites.net/MySrvc.svc"
            binding="wsDualHttpBinding" bindingConfiguration="wsDualEndpoint"
            contract="SrvcRef.IMySrvc" name="wsDualEndpoint" />
    </client>
</system.serviceModel>
jsanalytics
  • 13,058
  • 4
  • 22
  • 43
  • Possible same issue http://stackoverflow.com/questions/19922710/wcf-wsdualhttpbinding-binding-on-windows-azure-vm – dotnetstep Dec 25 '14 at 04:36
  • At this point I would like to ask: Has anyone ever had a WCF wsDualHttpBinding service actually working in a remote host, such as Azure? I just deployed my CLIENT (not the Service, still on Azure) in an EC2 machine on AWS cloud, just to make sure the problem is not with my dev machine, and the behavior is exactly the same, it just doesn't work.... Has anyone ever gotten wsDualHttpBinding actually working on a remote host? Please let me know. It is a YES or NO question. Thank you. – jsanalytics Dec 25 '14 at 07:06

1 Answers1

1

I knew this wsDualHttpBinding didn't pass the "smell test".... From Juval Lowy's book, "Programming WCF Services: Mastering WCF and the Azure AppFabric Service Bus":

...the WSDualHttpBinding is mostly unusable, since it is practically impossible to tunnel through various communication barriers separating the service from the client and the need to find a specific web-server machine makes this impractical.

I solved my problem by simply using netTcpBinding instead.... You just need to get IIS to work with TCP protocol. There's plenty of articles out there explaining how to do it. Here's one: http://msdn.microsoft.com/en-us/library/ms731053.aspx

Cheers.

jsanalytics
  • 13,058
  • 4
  • 22
  • 43