wcf学习--BasicHttpBinding 和 WsHttpBinding 的不同点
2012-09-14 16:40
429 查看
转载自:http://www.cnblogs.com/virusswb/archive/2010/02/21/1670225.html
BasicHttpBinding和WsHttpBinding的不同点
如果非要用一句话概述BasicHttpBinding和WsHttpBinding的不同的话,那就是WsHttpBinding支持WS- Security specifications,WS-Security specifications具有扩展web service的能力。
下面的表格式是对两者在安全、兼容性、可靠性和SOAP版本方面的比较。
两者之间最大的不同你一定已经注意到了,那就是安全。默认情况下,BasicHttpBinding发送的是明文数据,而 WsHttpBinding发送的是加密和更加安全的数据。为了证明这一点,我们新建两个服务,一个使用BasicHttpBinding,一个使用 WsHttpBinding,然后详细查看一下他们的安全方面。
说明:默认情况下,使用basicHttpBinding的时候,安全是没有启用的。换句话说,它很像以前的webservice,也就是.asmx。但是不意味着我们不能启用安全。稍后,我会写一篇关于basicHttpBinding启用安全的文章(http://www.codeproject.com/Articles/36289/8-steps-to-enable-windows-authentication-on-WCF-Ba)。
什么时候使用BasicHttpBinding,什么时候使用WsHttpBinding?
如果你希望有向后兼容的能力,并且支持更多的客户端,你可以选择basicHttpBinding,如果你确定你的客户端使用的是.NET 3.0甚至更高的话,你可以选择wsHttpBinding。
BasicHttpBinding和WsHttpBinding的不同点
如果非要用一句话概述BasicHttpBinding和WsHttpBinding的不同的话,那就是WsHttpBinding支持WS- Security specifications,WS-Security specifications具有扩展web service的能力。
下面的表格式是对两者在安全、兼容性、可靠性和SOAP版本方面的比较。
Criteria | BasicHttpBinding | WsHttpBinding |
Security support | This supports the old ASMX style, i.e. WS-BasicProfile 1.1. | This exposes web services using WS-* specifications. |
Compatibility | This is aimed for clients who do not have .NET 3.0 installed and it supports wider ranges of clients. Many of the clients like Windows 2000 still do not run .NET 3.0. So older version of .NET can consume this service. | As its built using WS-* specifications, it does not support wider ranges of client and it cannot be consumed by older .NET version less than 3 version. |
Soap version | SOAP 1.1 | SOAP 1.2 and WS-Addressing specification. |
Reliable messaging | Not supported. In other words, if a client fires two or three calls you really do not know if they will return back in the same order. | Supported as it supports WS-* specifications. |
Default security options | By default, there is no security provided for messages when the client calls happen. In other words, data is sent as plain text. | As WsHttBindingsupports WS-*, it has WS-Security enabled by default. So the data is not sent in plain text. |
Security options | None Windows – default authentication Basic Certificate | None Transport Message Transport with message credentials |
说明:默认情况下,使用basicHttpBinding的时候,安全是没有启用的。换句话说,它很像以前的webservice,也就是.asmx。但是不意味着我们不能启用安全。稍后,我会写一篇关于basicHttpBinding启用安全的文章(http://www.codeproject.com/Articles/36289/8-steps-to-enable-windows-authentication-on-WCF-Ba)。
什么时候使用BasicHttpBinding,什么时候使用WsHttpBinding?
如果你希望有向后兼容的能力,并且支持更多的客户端,你可以选择basicHttpBinding,如果你确定你的客户端使用的是.NET 3.0甚至更高的话,你可以选择wsHttpBinding。
相关文章推荐
- WCF系列(一)【翻译】BasicHttpBinding 和 WsHttpBinding 的不同点
- 学习笔记之 WCF安全(2) 基本身份验证(windows账号密码)(wsHttpBinding)
- 学习笔记之 WCF安全(3) 数字证书+ 自定义验证(wshttpBinding)
- 学习笔记之 WCF安全(5) 数字证书+ 客户端证书验证(wshttpBinding)
- 学习笔记之 WCF安全(6) 数字证书 自定义证书验证+ 客户端 证书验证(wshttpBinding)
- BasicHttpBinding 和 WsHttpBinding 的不同点
- 学习笔记之 WCF安全(1) SSL安全,无客户端验证(wsHttpBinding)
- WCF问题:找不到具有绑定 WSHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]"错误
- WCF 客户端 BasicHttpBinding 兼容 HTTPS 和 HTTP
- WCF HttpBinding 安全解析 (5)Basic验证(IIS宿主)
- WCF系列(六) - WCF安全系列(一) - basicHttpBinding
- [WCF安全系列]绑定、安全模式与客户端凭证类型:WSHttpBinding与WSDualHttpBinding
- WCF BasicHttpBinding 安全解析(6)Digest验证(IIS宿主)
- WCF安全系列(四) - WSHttpBinding绑定之Transport安全模式
- Wince设备使用WCF BasicHttpBinding方式与平台交互
- WCF系列(六) - WCF安全系列(一) - basicHttpBinding
- [WCF安全系列]绑定、安全模式与客户端凭证类型:BasicHttpBinding
- WS BasicHttpBinding 安全解析(7)Certificate验证(IIS宿主)
- WCF消息安全模式之自定义用户名密码:Message CustomUserNamePassword wsHttpBinding 使用Windows Services宿主以及客户端免证书验证
- WCF分布式安全开发实践(10):消息安全模式之自定义用户名密码:Message_UserNamePassword_WSHttpBinding