【问题标题】:What is the difference between BasicHttpsBinding and WsHttpBinding with Transport security?BasicHttpsBinding 和具有传输安全性的 WsHttpBinding 有什么区别?
【发布时间】:2013-02-14 12:08:25
【问题描述】:

由于 BasicHttpsBinding 是 .net 4.5 的新功能,我似乎无法找到关于两者之间差异的太多内容。

【问题讨论】:

  • 根据名称,我假设一个使用 HTTPS 作为传输,另一个使用 HTTP
  • 我认为传输安全也使用 https
  • 只有一条评论。 msdn.microsoft.com/en-us/library/… 此绑定的传输安全性是基于 HTTP 或 HTTPS 的安全套接字层 (SSL)。我认为 SSL over HTTP 意味着 WS 正在做 SSL 部分。再次只是一个评论。

标签: .net wshttpbinding


【解决方案1】:

确实,这两个绑定非常相似。唯一真正的区别是需要 HTTPS,端点需要配置一个 BasicHttpBinding,在其中您将安全模式定义为传输(或任何其他有效枚举)。使用端点上的 BasicHttpsBinding,安全模式默认为传输,客户端凭据类型设置为无。

这是您在 WCF 4.5 之前的配置:

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="Service.BasicHttp.BindingConfig">
        <security mode="Transport" />        
      </binding>
    </basicHttpBinding>
  </bindings>
  <services>
    <service name="ServiceImpl">
      <endpoint address="" binding="basicHttpBinding" bindingConfiguration="Service.BasicHttp.BindingConfig"
                name="IService.Http" contract="IService">
      </endpoint>
    </service>
  </services>
</system.serviceModel>

使用 WCF 4.5,可以将相同的配置简化为:

<system.serviceModel>
  <services>
    <service name="ServiceImpl">
      <endpoint address="" binding="basicHttpsBinding" name="IService.Http" contract="IService">
  </endpoint>
</service>
  </services>
</system.serviceModel>

更多详情请参阅What’s new in WCF 4.5? BasicHttpsBinding

【讨论】:

  • 有趣。这个答案比较了 basicHttpsBinding 和 basicHttpBinding 但原始问题标题询问 basicHttpsBinding 和 WSHttpBinding (WS=WebService) 之间的区别。
猜你喜欢
  • 2012-08-08
  • 2013-02-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-18
  • 1970-01-01
相关资源
最近更新 更多