Does WCF always use SOAP to send information over your binding?

扶醉桌前 提交于 2019-11-30 04:00:51

No, not all. The WebHttpBinding is designed around REST protocols (HTTP GET, POX, JSON, etc.)

Technically, WCF is just a generic messaging protocol and can use any kind of encoding at all. The default and most common encodings are basicHttpBinding and wsHttpBinding, which are both based around SOAP/XML.

Then you have netTcpBinding, which uses a binary message encoding, netMsmqBinding, which uses the Microsoft Message Queue (MSMQ) protocol, and so on. There's really no hard-coded format for messages in WCF.

SOAP has its own specification for serializing exceptions (AKA faults), so the behaviour is always more or less the same when you use a SOAP-based binding; when you use other bindings, the faulting behaviour may be considerably different, in some cases actually swallowing exceptions unless you override the default behaviour (this is what happens in the webHttpBinding).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!