XML and SOAP Serialization
XML serialization converts (serializes) the public fields and properties of an object, or the parameters and return values of methods, into an XML stream that conforms to a specific XML Schema definition language (XSD) document. XML serialization results in strongly typed classes with public properties and fields that are converted to a serial format (in this case, XML) for storage or transport.
Because XML is an open standard, the XML stream can be processed by any application, as needed, regardless of platform. For example, XML Web services created using ASP.NET use the XmlSerializer class to create XML streams that pass data between XML Web service applications throughout the Internet or on intranets. Conversely, deserialization takes such an XML stream and reconstructs the object.
XML serialization can also be used to serialize objects into XML streams that conform to the SOAP specification. SOAP is a protocol based on XML, designed specifically to transport procedure calls using XML.
To serialize or deserialize objects, use the XmlSerializer class. To create the classes to be serialized, use the XML Schema Definition tool.
In This Section
- Introducing XML Serialization
- Provides a general definition of serialization, particularly XML serialization.
- How to: Serialize an Object
- Provides step-by-step instructions for serializing an object.
- How to: Deserialize an Object
- Provides step-by-step instructions for deserializing an object.
- Examples of XML Serialization
- Provides examples that demonstrate the basics of XML serialization.
- The XML Schema Definition Tool and XML Serialization
- Describes how to use the XML Schema Definition tool to create classes that adhere to a particular XML Schema definition language (XSD) schema, or to generate an XML Schema from a .dll file.
- Controlling XML Serialization Using Attributes
- Describes how to control serialization by using attributes.
- Attributes That Control XML Serialization
- Lists the attributes that are used to control XML serialization.
- How to: Specify an Alternate Element Name for an XML Stream
- Presents an advanced scenario showing how to generate multiple XML streams by overriding the serialization.
- How to: Control Serialization of Derived Classes
- Provides an example of how to control the serialization of derived classes.
- How to: Qualify XML Element and XML Attribute Names
- Describes how to define and control the way in which XML namespaces are used in the XML stream.
- XML Serialization with XML Web Services
- Explains how XML serialization is used in XML Web services.
- How to: Serialize an Object as a SOAP-Encoded XML Stream
- Describes how to use the XmlSerializer class to create encoded SOAP XML streams that conform to section 5 of the World Wide Web Consortium (www.w3.org) document titled "Simple Object Access Protocol (SOAP) 1.1."
- How to: Override Encoded SOAP XML Serialization
- Describes the process for overriding XML serialization of objects as SOAP messages.
- Attributes That Control Encoded SOAP Serialization
- Lists the attributes that are used to control SOAP-encoded serialization.
- <system.xml.serialization> Element
- The top-level configuration element for controlling XML serialization.
Other ResourcesBinary Serialization