.net - BasicHttpsBinding 和具有传输安全性的 WsHttpBinding 有什么区别?

标签 .net wshttpbinding

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

最佳答案

事实上,这两个绑定(bind)非常相似。唯一真正的区别是需要 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了解更多详情。

关于.net - BasicHttpsBinding 和具有传输安全性的 WsHttpBinding 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14874529/

相关文章:

wcf - 使用安全模式="TransportWithMessageCredential"测试WCF服务wsHttpBinding

wcf - 带有 TransportWithMessageCredential 的 WCF 是否使用 SSL?

c# - 如何通过在 List C# 中传递复选框名称在 Winform 上创建动态复选框?

c# - .Net Mvc : How to fire a error for Application_Error() manage them?

c# - ASP MVC : How get roles from ApplicationUser

WCF 自托管服务 SSL/传输安全/基本身份验证不要求凭据

c# - HttpResponseMessage 的通用版本是否已从 ASP.NET WebApi 中删除?

c# - 根级别的数据无效。第 1 行,位置 1 MonoTouch

wcf - Roles.IsUserInRole() 在使用 wsHttpBinding 和 MVC 4 的 WCF 中不起作用

c# - 我应该使用 basicHttpBinding 还是 WsHttpBinding 来创建安全的 Java 客户端?