Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What type of serialization uses Wcf behind the scenes?

Tags:

wcf

I know there's 3 type s of serialization in .net :

Soap , Xml , Binary.

Wcf instructed the DataContract attribute which also serialize ... but via what ?

Binary is not - i know.

So by which mechanism ?

like image 668
Royi Namir Avatar asked Sep 03 '11 08:09

Royi Namir


People also ask

What is serialization in WCF?

Windows Communication Foundation (WCF) uses the DataContractSerializer as its default serialization engine to convert data into XML and to convert XML back into data. The DataContractSerializer is designed to serialize data contract types.

Which namespace is used for serialization in WCF?

DataContractSerializer as the Default By default WCF uses the DataContractSerializer class to serialize data types.

What is serialization and Deserialization in WCF?

For an introduction to data contracts, see Using Data Contracts. When deserializing XML, the serializer uses the XmlReader and XmlWriter classes. It also supports the XmlDictionaryReader and XmlDictionaryWriter classes to enable it to produce optimized XML in some cases, such as when using the WCF binary XML format.


1 Answers

It is the binding defined for the given endpoint which specifies the serialization mechanism. For example:

  • basicHttpBinding and wsHttpBinding use SOAP
  • netTcpBinding uses binary serialization
  • webHttpBinding 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.

like image 184
Darin Dimitrov Avatar answered Nov 16 '22 01:11

Darin Dimitrov