Sample code on XML and soap serialization

Serialization is a process by which you can save an object in the form of a file or in a database or in the memory to be used later. Serialization can be done in different ways.


_______________________________________________

One is Binary serialization, the other is XML serialization, and the final one is the SOAP serialization. All these types of serialization are supported in .Net.

With the XML serialization you can serialize all the public properties and fields. The private members cannot be serialized. Other types of serialization should be used if you want to serialize the private members.

With this type of serialization only the class that does not implement IDictionary can be serialized. The IsNullable attribute is to be set to true if you want to serialize the Null values. MemoryStream is used if you want to store the object in the memory.

SOAP and Binary serialization can be used to serialize the private fields. If you do not want to serialize an object then you have to use the attribute [NonSerialized]. You can mark the class as serializable with the [Serializable] attribute.

Serializable attribute cannot be inherited from the parent class. Make all the members serialization to serialize a class. Classes that implement IDictionary can be serialized with the SOAP and Binary serialization.

Lot of code samples is available in the internet for serialization and deserialization.




_______________________________________________

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________



 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.