.Net Interview Questions and Answers

Search:

WCF interview questions with answers :- What is DataContractSerializer and how it's different from XmlSerializer ?

By : Shiv Prasad Koirala | Sep 1st, 2013 | Views : 21346 | Comments : 0 Bookmark and Share

This interview question is taken from .NET interview question and answer book published by Bpb publications.

 

First of all Serialization is a process of translating Object state into a format that can be stored and if want transmitted.

 

In this article I would like to talk about difference between XmlSerializer and DataContractSerialzier.

 

DataContractSerializer

XmlSerializer

Best when we want to serialize some of the properties in object.

It uses Opt-In approach. It means we have to explicitly specify which properties need to be serialized

Best when we want to serialize most of the properties in object.

It used Opt-out approach. It means we have to explicitly specify which properties you don't want to serialize

It can serialize not only properties but also fields.

It can also serialize nonpublic members

It can serialize properties with only Get Accessor

It can only serialize public properties which must have both Get and Set Accessor.

Faster

Slower compare to DataContractSerializer

It can only work in WCF

It can work for WCF and Webservices (asmx)

 

This WCF interview question with answer is sponsored by www.questpond.com

 

Below is a simple WCF interview question with answer video which talks about can we overload WCF operation contract methods.

 

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi