简体   繁体   中英

wsDualHttpBinding Not Working When Deployed Under Azure

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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