I know there\'s 3 type s of serialization in .net :
Soap , Xml , Binary.
Wcf instructed the DataContract attribute which also serialize ... bu
It is the binding defined for the given endpoint which specifies the serialization mechanism. For example:
basicHttpBinding
and wsHttpBinding
use SOAPnetTcpBinding
uses binary serializationwebHttpBinding
could use XML, Json, ...You can read more about the different built-in bindings and their properties on this article. Thanks to the extensibility of WCF you could of course write your own custom bindings.
You are messing two techniques together.
DataContractSerializer
, DataContractJsonSerializer
, XmlSerializer
)TextMessageEncoder
- for SOAP messages transferred as text - also supports MTOM and POX (Plain old XML) if message version is set to None
BinaryMessageEncoder
- for XML/SOAP messages transferred as binary dataWebMessageEncoder
- for XML and JSON messages in REST servicesThese features are used by standard bindings. WCF support as many serializations and encoding as you want => you can build your own.