Events
Mar 17, 9 p.m. - Mar 21, 10 a.m.
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
XML serialization converts (serializes) the public fields and properties of an object, and 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.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 p.m. - Mar 21, 10 a.m.
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Work with web services in Dynamics 365 Business Central - Training
Use SOAP and OData to read and update records, and handle UI interaction in Business Central.
Documentation
How to: Serialize an Object - .NET
This article shows you how to serialize an object. Select a transport format in which the XML stream is stored, either as a stream or as a file.
Examples of XML Serialization - .NET
These code examples show advanced scenarios, including how to use XML serialization to generate an XML stream that conforms to an XML Schema document.
Controlling XML Serialization Using Attributes - .NET
Attributes can be used to control the XML serialization of an object or to create an alternate XML stream from the same set of classes.