Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I understand you can choose from a range of bindings, such as TCP, HTTP, HTTPS etc.

Am I correct in thinking it always uses SOAP to send data over this connection? I am watching a guide to WCF and it is talking about how exceptions are serialized into SOAP and sent to the client. I would have thought that not all bindings would use SOAP to send data, so I am a bit confused about how it works.

Although I understand the fundamentals of WCF, how to set up services and use a proxy on the client, it doesn't seem to have explained exactly how the data is packaged up to send.

Perhaps the answer is obvious, that it just uses XML / SOAP, but I would love to know for sure!

like image 479
NibblyPig Avatar asked May 03 '10 20:05

NibblyPig


People also ask

Is WCF soap?

WCF services use SOAP by default, but the messages can be in any format, and conveyed by using any transport protocol like HTTP,HTTPs, WS- HTTP, TCP, Named Pipes, MSMQ, P2P(Point to Point) etc.

How to decide which binding to use in WCF?

Choosing a Binding The first question you should ask yourself is whether your service needs to interact with non-WCF clients. If the answer is yes, and if the client is a legacy MSMQ client, choose the MsmqIntegrationBinding that enables your service to interoperate over MSMQ with such a client.

What is binding in WCF?

Bindings are objects that are used to specify the communication details that are required to connect to the endpoint of a Windows Communication Foundation (WCF) service. Each endpoint in a WCF service requires a binding to be well-specified.

Which of the following WCF binding is used for cross machine communication on the Internet?

NetMsmqBinding. It is used for queue communication. It means that this binding gives us secure and reliable queued communication for the cross machine environment. Uses MSMQ as transport protocol and provides reliable, robust and distributed application.


1 Answers

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).

like image 199
Aaronaught Avatar answered Oct 31 '22 17:10

Aaronaught