与交通运输安全BasicHttpsBinding和WsHttpBinding的之间的区别是什么?交通运输、区别、安全、BasicHttpsBinding

由网友(你有矿泉水那么纯。么?)分享简介:由于BasicHttpsBinding是新的.NET 4.5,我似乎并没有能够找到围绕两者之间的差异太多的东西。As BasicHttpsBinding is new at .net 4.5, I don't seem to be able to find much stuff around differences...

由于BasicHttpsBinding是新的.NET 4.5,我似乎并没有能够找到围绕两者之间的差异太多的东西。

As BasicHttpsBinding is new at .net 4.5, I don't seem to be able to find much stuff around differences between the two.

推荐答案

事实上两者绑定非常相似。唯一的区别是,需要HTTPS,端点必须要与您在其中定义了安全模式为交通运输(或任何其他有效的枚举)一个basicHttpBinding的配置。随着对端点BasicHttpsBinding,安全模式默认为运输和客户端凭据类型设置为无。

Indeed the two bindings are very similar. The only real difference is that to require HTTPS, the endpoint needed to be configured with a BasicHttpBinding in which you define the security mode as Transport (or any of the other valid enumerations). With a BasicHttpsBinding on the endpoint, the security mode is defaulted to Transport and the client credential type is set to None.

因此​​,这里是WCF 4.5之前,你的配置:

So here was your configuration before 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,相同的配置可被简化为:

With WCF 4.5, the same configuration can be simplified to:

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

请参阅What’s新的WCF 4.5? BasicHttpsBinding 获取更多细节。

阅读全文

相关推荐

最新文章