【问题标题】:wsDualHttpBinding Not Working When Deployed Under AzurewsDualHttpBinding 在 Azure 下部署时不起作用
【发布时间】:2014-12-25 03:37:06
【问题描述】:

WCF Duplex 在 Azure 下不工作。 在 IIS Express 下一切正常。 我知道由于服务器回调,双工绑定是有问题的,但是.... 我已经关闭了我的防火墙。 TCPView(Sysinternals)显示客户端正在发送/接收 10 到 12 个数据包,然后它就死了……什么也没发生。 我将所有超时设置为 10 分钟。

请在下面查看我的配置文件。

服务器配置:

  <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" />

客户端配置:

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

【问题讨论】:

  • 此时我想问一下:有没有人有一个 WCF wsDualHttpBinding 服务实际上在远程主机上工作,比如 Azure?我刚刚在 AWS 云上的 EC2 机器上部署了我的 CLIENT(不是服务,仍在 Azure 上),只是为了确保问题不在我的开发机器上,并且行为完全相同,只是不起作用。 ... 有没有人让 wsDualHttpBinding 实际上在远程主机上工作?请告诉我。这是一个是或否的问题。谢谢。

标签: c# wcf azure wsdualhttpbinding


【解决方案1】:

我知道这个 wsDualHttpBinding 没有通过“气味测试”.... 摘自 Juval Lowy 的书“编程 WCF 服务:掌握 WCF 和 Azure AppFabric 服务总线”:

...WSDualHttpBinding 几乎无法使用,因为实际上不可能通过将服务与客户端分开的各种通信障碍进行隧道传输,并且需要找到特定的 Web 服务器机器使得这不切实际.

我通过简单地使用 netTcpBinding 解决了我的问题.... 您只需要让 IIS 与 TCP 协议一起工作。 那里有很多文章解释了如何做到这一点。 这是一个: http://msdn.microsoft.com/en-us/library/ms731053.aspx

干杯。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-20
    • 1970-01-01
    • 2015-05-03
    • 1970-01-01
    相关资源
    最近更新 更多