zoukankan      html  css  js  c++  java
  • WCF—Binding

    Binding描述了哪些层面的信息

    一个Binding包含着丰富的信息,每种信息都描述了服务端和客户端交互过程中的一方面,如下表所示,Binding描述了这些层面的信息:

    层次

    备注说明

    Transactions(事务)

    TransactionFlowBindingElement,用于指定事务流程

    Reliability(信赖)

    ReliableSessionBindingElement,用于指定对会话方式

    Security(安全)

    SecurityBindingElement,指定安全方式

    Encoding(编码)

    Text, Binary, MTOM, Custom,指定数据传输格式

    Transport(传输)

    TCP, Named Pipes, HTTP, HTTPS, MSMQ, Custom,指定传输方式

     

    选择正确的Binding

    Binding是可以自定义实现的,可WCF框架已经为我们实现了足够多的Binding,供我们来选择,

    如下表所示:

    Binding名称

    Configuration Element

    描述

    BasicHttpBinding

    basicHttpBinding

    一个指定用符合基本网络服务规范通讯的binding,它用http进行传输,数据格式为text/xml

    WSHttpBinding

    wsHttpBinding

    一个安全的通用的binding,但它不能在deplex中使用

    WSDualHttpBinding

    wsDualHttpBinding

    一个安全的通用的binding,但能在deplex中使用

    WSFederationHttpBinding

    wsFederationHttpBinding

    一个安全的通用的支持WSFbinding,能对用户进行验证和授权

    NetTcpBinding

    netTcpBinding

    wcf应用程序中最适合跨机器进行安全通讯的binding

    NetNamedPipeBinding

    netNamedPipeBinding

    wcf应用程序中最适合本机进行安全通讯的binding

    NetMsmqBinding

    netMsmqBinding

    wcf应用程序中最适合跨机器进行安全通讯的binding,并且支持排队

    NetPeerTcpBinding

    netPeerTcpBinding

    一个支持安全的,多机交互的binding

    MsmqIntegrationBinding

    msmqIntegrationBinding

    一个用于wcf与现有msmq程序进行安全通讯的binding

     

    下面的表格分别删除了上表中的Binding在互操作性(Interoperability) 安全性(Security) 是否支持会话(Session) 是否支持事务(Transactions)和是否为全双工(Duplex)上不同。

     

     

    Bingding

    Interoperability

    Security

    Session

    Transactions

    Duplex

    BasicHttpBinding

    Basic Profile 1.1

    (None), Transport, Message

    None, (None)

    None

    n/a

    WSHttpBinding

    WS

    Transport, (Message), Mixed

    (None), Transport, Reliable Session

    (None), Yes

    n/a

    WSDualHttpBinding

    WS

    (Message)

    (Reliable Session)

    (None), Yes

    Yes

    WSFederationHttpBinding

    WS-Federation

    (Message)

    (None), Reliable Session

    (None), Yes

    No

    NetTcpBinding

    .NET

    (Transport), Message

    Reliable Session, (Transport)

    (None), Yes

    Yes

    NetNamedPipeBinding

    .NET

    (Transport)

    None, (Transport)

    (None), Yes

    Yes

    NetMsmqBinding

    .NET

    Message, (Transport), Both

    (None)

    (None), Yes

    No

    NetPeerTcpBinding

    Peer

    (Transport)

    (None)

    (None)

    Yes

    MsmqIntegrationBinding

    MSMQ

    (Transport)

    (None)

    (None), Yes

    n/a

     

     

     

     

    ·BasicHttpBinding: 最简单的绑定类型,通常用于 Web Services。使用 HTTP 协议,Text/XML 编码方式。
    ·WSHttpBinding:
    BasicHttpBinding 更加安全,通常用于 non-duplex 服务通讯。
    ·WSDualHttpBinding:
    WSHttpBinding 相比,它支持 duplex 类型的服务。
    ·WSFederationHttpBinding:
    支持 WS-Federation 安全通讯协议。
    ·NetTcpBinding:
    效率最高,安全的跨机器通讯方式。
    ·NetNamedPipeBinding:
    安全、可靠、高效的单机服务通讯方式。
    ·NetMsmqBinding:
    使用消息队列在不同机器间进行通讯。
    ·NetPeerTcpBinding:
    使用 P2P 协议在多机器间通讯。
    ·MsmqIntegrationBinding:
    使用现有的消息队列系统进行跨机器通讯。如 MSMQ

    仅作参考。

    片段摘自:

    http://www.rainsts.net/article.asp?id=439

    http://www.cnblogs.com/jillzhang/archive/2008/02/03/1063406.html

  • 相关阅读:
    POJ 3579 Median (二分)
    POJ 2976(01分数划分+二分)
    CodeForces
    hdu3555 Bomb(数位dp)
    hdu 2476 String painter(区间dp)
    poj 2955 Brackets(区间dp)
    HDU 2665(主席树,无修改第k小)
    BNUOJ ->Borrow Classroom(LCA)
    poj 2763(在线LCA+树状数组)
    Jmeter-常用线程组设置及场景运行时间计算
  • 原文地址:https://www.cnblogs.com/jams742003/p/1646379.html
Copyright © 2011-2022 走看看