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

    原文地址: http://www.cnblogs.com/jams742003/archive/2010/01/13/1646379.html

    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

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

    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

    博客园大道至简

    http://www.cnblogs.com/jams742003/

    转载请注明:博客园

  • 相关阅读:
    EasyUI的datagrid在IE下解决缓存的方案
    [置顶] 【Mybatis】---mybatis+mysql+ IntelliJ IDEA框架搭建+实例讲解
    【深入分析JavaWeb】-DNS域名解析
    hibernate对JPA_Annotation的支持实例讲解
    【hibernate进阶】hql简单属性查询
    LeetCode 10. 正则表达式匹配
    机器学习(Machine Learning)- 吴恩达(Andrew Ng) 学习笔记(七)
    机器学习(Machine Learning)- 吴恩达(Andrew Ng) 学习笔记(六)
    机器学习(Machine Learning)- 吴恩达(Andrew Ng) 学习笔记(五)
    机器学习(Machine Learning)- 吴恩达(Andrew Ng) 学习笔记(四)
  • 原文地址:https://www.cnblogs.com/niaowo/p/4728180.html
Copyright © 2011-2022 走看看