SkeetJon
SkeetJon

Reputation: 1491

WCF binding confusion re Message Format

Im getting confused with WCF, can someone clarify this for me please.

According to Michele Leroux's WCF book the following is true.

"Regardless of the message-encoding format, messages are represented on the wire either as SOAP 1.1 or SOAP 1.2" - I confirmed this by creating a simple net.tcp bound service and used the WCF test client to see the request and response XML.

According to http://www.codemeit.com/wcf/wcf-restful-pox-json-and-soap-coexist.html however, the following is true."webHttpBinding specifies that the service understands generic HTTP requests instead of SOAP requests. The REST service is built on top of generic HTTP request with GET HTTP verb."

So how can both these statements be true?

Upvotes: 0

Views: 237

Answers (1)

Richard Blewett
Richard Blewett

Reputation: 6109

WCF now has a split personality. The vast majority of it talks SOAP (1.1 or 1.2) and messages end up structured as SOAP on the wire even if the encoder produces something other than XML

However, the WebHttpBinding is special. It uses the Json/POX encoder which strips all of the SOAP framing off the message just sending the message body, however that happens to be structured, down the wire. This means that it can be used to send any content type over HTTP

Upvotes: 2

Related Questions