不论是我们采用SOAP还是REST架构风格,运行时框架体系依然不曾改变,终结点也仍旧是通信的核心。在Web HTTP编程模型中,我们采用基于WebHttpBinding绑定的终结点。绑定是一组相关绑定元素的有序组合,绑定的特性与能力决定于它包含的绑定元素,在这里我们通过分析绑定元素的方式来剖析WebHttpBinding绑定与其它绑定有何不同。采用HTTP/HTTPS通信协议的WebHttpBinding具有一些与WSHttpBinding/WS2007HttpBinding相同的属性,在这里我们只关心如下定义的Security属性。

class WebHttpBinding : Binding, IBindingRuntimePreferences
   2: {
//其它成员
public WebHttpSecurity Security { get; }
   5: }
class WebHttpSecurity
   7: {
// 其它成员
public WebHttpSecurityMode Mode { get; set; }
public HttpTransportSecurity Transport { get; }
  11: }
enum WebHttpSecurityMode
  13: {
  14:     None,
  15:     Transport,
  16:     TransportCredentialOnly
  17: }

相关文章: