.net basicHttpBinding 与 wsHttpBinding

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2106715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 13:49:54  来源:igfitidea点击:

basicHttpBinding vs wsHttpBinding

.netwcfweb-serviceswcf-bindingmtom

提问by Craig Schwarze

In a WCF endpoint, what is the difference between basicHttpBinding and wsHttpBinding? When should each be used?

在 WCF 端点中,basicHttpBinding 和 wsHttpBinding 之间有什么区别?每个应该什么时候使用?

回答by marc_s

Ton of material on that out there - just google for "WCF basicHttpBinding wsHttpBinding".

关于那里的大量材料 - 只需谷歌搜索“WCF basicHttpBinding wsHttpBinding”。

You'll find amongst others:

您会发现其中包括:

Very basically:

非常基本:

  • basicHttp is SOAP 1.1, wsHttp is SOAP 1.2 (they're quite different, esp. when it comes to SOAP faults)
  • basic is - very basic. It's compatible with old-style ASMX ASP.NET webservices and just about any other web service stack out there
  • basic is very limited in its security settings
  • wsHttp is an implementation of a gazillion WS-* standards, and offers much more features: security, reliable messaging, transaction support, duplex communications and a whole host more.
  • wsHttp is the much "heavier" and more extensive protocol, less compatible, less nimble
  • basicHttp 是 SOAP 1.1,wsHttp 是 SOAP 1.2(它们完全不同,尤其是在涉及 SOAP 错误时)
  • 基本是 - 非常基本。它与旧式 ASMX ASP.NET webservices 以及几乎任何其他 web 服务堆栈兼容
  • basic 的安全设置非常有限
  • wsHttp 是无数 WS-* 标准的实现,并提供了更多功能:安全性、可靠的消息传递、事务支持、双工通信和更多的主机。
  • wsHttp 是“更重”和更广泛的协议,兼容性较差,灵活性较差

回答by mahesh

wsHttpBindingis more secure and reliable than basicHttpBinding. If great compatibility is not required, wsHttpBindingis the choice.

wsHttpBinding比 更安全可靠basicHttpBinding。如果不需要很好的兼容性,wsHttpBinding则是选择。

Ref: BasicHttpBinding vs WSHttpBinding

参考:BasicHttpBinding 与 WSHttpBinding

BasicHttpBinding:

BasicHttpBinding

  1. WS-I Basic Profile 1.1 specification (Old ASMX style)
  2. It supports SOAP 1.1 as a messaging protocol
  3. Doesn't support WS-Security, and the entire payload is sent in plain text.
  4. Offers great level of interoperability.
  1. WS-I 基本配置文件 1.1 规范(旧 ASMX 样式)
  2. 它支持 SOAP 1.1 作为消息传递协议
  3. 不支持 WS-Security,并且整个有效负载以纯文本形式发送。
  4. 提供高水平的互操作性。

WSHttpBinding:

WSHttpBinding

  1. Allows you to use various WS-* specifications such as WS-Security 1.1, WS-Reliable Messaging etc
  2. It supports SOAP 1.2 as a messaging protocol
  3. As its built using WS-* specifications, it does not support wider ranges of client.
  1. 允许您使用各种 WS-* 规范,例如 WS-Security 1.1、WS-Reliable Messaging 等
  2. 它支持 SOAP 1.2 作为消息传递协议
  3. 由于其使用 WS-* 规范构建,因此不支持更广泛的客户端。