Export (0) Print
Expand All
Expand Minimize
1 out of 6 rated this helpful - Rate this topic

System.Xml.Serialization Namespace

The System.Xml.Serialization namespace contains classes that are used to serialize objects into XML format documents or streams.

The central class in the namespace is the XmlSerializer class. To use this class, use the XmlSerializer constructor to create an instance of the class using the type of the object to serialize. Once an XmlSerializer is created, create an instance of the object to serialize. You must also create an object to write the file to a document or stream, such as a Stream, TextWriter, or XmlWriter. You can then call the Serialize method to convert the object into an XML document.

To deserialize an object from an XML document, create a suitable object to read the document or stream (again, a Stream, TextWriter, or XmlWriter). Invoke the Deserialize method while casting the resulting object to the type of the original object (that was serialized).

To further control the serialization, the System.Xml.Serialization namespace contains several Attribute classes that can be applied to members of a class. For example, if a class contains a member that will be serialized as an XML element, you can apply the XmlElementAttribute attribute to the member. When applying the attribute, you can specify details such as the actual XML element name using the ElementName property. For a complete list of all the attributes, see the XmlSerializer class overview.

  Class Description
Public class CodeExporter Represents a class that can generate proxy code from an XML representation of a data structure.
Public class CodeIdentifier Infrastructure. Provides static methods to convert input text into names for code entities.
Public class CodeIdentifiers Infrastructure. Maintains a group of names for related code entities or type mappings that are generated by the .NET Framework's XML serialization infrastructure.
Public class ImportContext Infrastructure. Describes the context in which a set of schema is bound to .NET Framework code entities.
Public class SchemaImporter Describes a schema importer.
Public class SoapAttributeAttribute Specifies that the XmlSerializer must serialize the class member as an encoded SOAP attribute.
Public class SoapAttributeOverrides Allows you to override attributes applied to properties, fields, and classes when you use an XmlSerializer to serialize or deserialize an object as encoded SOAP.
Public class SoapAttributes Represents a collection of attribute objects that control how the XmlSerializer serializes and deserializes SOAP methods.
Public class SoapCodeExporter Infrastructure. Generates types and attribute declarations from internal type mapping information for SOAP-encoded message parts defined in a WSDL document.
Public class SoapElementAttribute Specifies that the public member value be serialized by the XmlSerializer as an encoded SOAP XML element.
Public class SoapEnumAttribute Controls how the XmlSerializer serializes an enumeration member.
Public class SoapIgnoreAttribute Instructs the XmlSerializer not to serialize the public field or public read/write property value.
Public class SoapIncludeAttribute Allows the XmlSerializer to recognize a type when it serializes or deserializes an object as encoded SOAP XML.
Public class SoapReflectionImporter Generates mappings to SOAP-encoded messages from .NET Framework types or Web service method information.
Public class SoapSchemaExporter Infrastructure. Populates XmlSchema objects with XML Schema data type definitions for .NET Framework types that are serialized using SOAP encoding.
Public class SoapSchemaImporter Infrastructure. Used within the .NET Framework to generate internal mappings to .NET Framework types for SOAP-encoded message parts in a WSDL document.
Public class SoapSchemaMember Infrastructure. Represents certain attributes of a XSD <part> element in a WSDL document for generating classes from the document.
Public class SoapTypeAttribute Controls the schema generated by the XmlSerializer when a class instance is serialized as SOAP encoded XML.
Public class UnreferencedObjectEventArgs Provides data for the known, but unreferenced, object found in an encoded SOAP XML stream during deserialization.
Public class Supported in .NET for Windows Store apps XmlAnyAttributeAttribute Specifies that the member (a field that returns an array of XmlAttribute objects) can contain any XML attributes.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlAnyElementAttribute Specifies that the member (a field that returns an array of XmlElement or XmlNode objects) contains objects that represent any XML element that has no corresponding member in the object being serialized or deserialized.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlAnyElementAttributes Represents a collection of XmlAnyElementAttribute objects.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlArrayAttribute Specifies that the XmlSerializer must serialize a particular class member as an array of XML elements.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlArrayItemAttribute Represents an attribute that specifies the derived types that the XmlSerializer can place in a serialized array.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlArrayItemAttributes Represents a collection of XmlArrayItemAttribute objects.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlAttributeAttribute Specifies that the XmlSerializer must serialize the class member as an XML attribute.
Public class XmlAttributeEventArgs Provides data for the UnknownAttribute event.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlAttributeOverrides Allows you to override property, field, and class attributes when you use the XmlSerializer to serialize or deserialize an object.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlAttributes Represents a collection of attribute objects that control how the XmlSerializer serializes and deserializes an object.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlChoiceIdentifierAttribute Specifies that the member can be further detected by using an enumeration.
Public class XmlCodeExporter Infrastructure. Generates types and attribute declarations from internal type mapping information for XML schema element declarations.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlElementAttribute Indicates that a public field or property represents an XML element when the XmlSerializer serializes or deserializes the object that contains it.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlElementAttributes Represents a collection of XmlElementAttribute objects used by the XmlSerializer to override the default way it serializes a class.
Public class XmlElementEventArgs Provides data for the UnknownElement event.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlEnumAttribute Controls how the XmlSerializer serializes an enumeration member.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlIgnoreAttribute Instructs the Serialize method of the XmlSerializer not to serialize the public field or public read/write property value.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlIncludeAttribute Allows the XmlSerializer to recognize a type when it serializes or deserializes an object.
Public class Supported by Portable Class Library XmlMapping Infrastructure. Supports mappings between .NET Framework types and XML Schema data types.
Public class XmlMemberMapping Infrastructure. Maps a code entity in a .NET Framework Web service method to an element in a Web Services Description Language (WSDL) message.
Public class XmlMembersMapping Infrastructure. Provides mappings between .NET Framework Web service methods and Web Services Description Language (WSDL) messages that are defined for SOAP Web services.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlNamespaceDeclarationsAttribute Specifies that the target property, parameter, return value, or class member contains prefixes associated with namespaces that are used within an XML document.
Public class XmlNodeEventArgs Provides data for the UnknownNode event.
Public class XmlReflectionImporter Infrastructure. Generates mappings to XML schema element declarations, including literal XML Schema Definition (XSD) message parts in a Web Services Description Language (WSDL) document, for .NET Framework types or Web service method information.
Public class XmlReflectionMember Infrastructure. Provides mappings between code entities in .NET Framework Web service methods and the content of Web Services Description Language (WSDL) messages that are defined for SOAP Web services.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlRootAttribute Controls XML serialization of the attribute target as an XML root element.
Public class XmlSchemaEnumerator Enables iteration over a collection of XmlSchema objects.
Public class XmlSchemaExporter Infrastructure. Populates XmlSchema objects with XML schema element declarations that are found in type mapping objects.
Public class XmlSchemaImporter Infrastructure. Generates internal mappings to .NET Framework types for XML schema element declarations, including literal XSD message parts in a WSDL document.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlSchemaProviderAttribute When applied to a type, stores the name of a static method of the type that returns an XML schema and a XmlQualifiedName (or XmlSchemaType for anonymous types) that controls the serialization of the type.
Public class XmlSchemas Infrastructure. Represents the collection of XML schemas.
Public class XmlSerializationGeneratedCode Infrastructure. An abstract class that is the base class for XmlSerializationReader and XmlSerializationWriter and that contains methods common to both of these types.
Public class XmlSerializationReader Infrastructure. Controls deserialization by the XmlSerializer class.
Protected class XmlSerializationReader.CollectionFixup Holds an XmlSerializationCollectionFixupCallback delegate instance, plus the method's inputs; also supplies the method's parameters.
Protected class XmlSerializationReader.Fixup Infrastructure. Holds an XmlSerializationFixupCallback delegate instance, plus the method's inputs; also serves as the parameter for the method.
Public class XmlSerializationWriter Infrastructure. Represents an abstract class used for controlling serialization by the XmlSerializer class.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlSerializer Serializes and deserializes objects into and from XML documents. The XmlSerializer enables you to control how objects are encoded into XML.
Public class XmlSerializerAssemblyAttribute Applied to a Web service client proxy, enables you to specify an assembly that contains custom-made serializers.
Public class XmlSerializerFactory Infrastructure. Creates typed versions of the XmlSerializer for more efficient serialization.
Public class XmlSerializerImplementation Infrastructure. Defines the reader, writer, and methods for pre-generated, typed serializers.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlSerializerNamespaces Contains the XML namespaces and prefixes that the XmlSerializer uses to generate qualified names in an XML-document instance.
Public class XmlSerializerVersionAttribute Signifies that the code was generated by the serialization infrastructure and can be reused for increased performance, when this attribute is applied to an assembly.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlTextAttribute Indicates to the XmlSerializer that the member must be treated as XML text when the class that contains it is serialized or deserialized.
Public class Supported by Portable Class Library Supported in .NET for Windows Store apps XmlTypeAttribute Controls the XML schema that is generated when the attribute target is serialized by the XmlSerializer.
Public class Supported by Portable Class Library XmlTypeMapping Contains a mapping of one type to another.
  Structure Description
Public structure XmlDeserializationEvents Contains fields that can be used to pass event delegates to a thread-safe Deserialize method of the XmlSerializer.
  Interface Description
Public interface Supported by Portable Class Library Supported in .NET for Windows Store apps IXmlSerializable Provides custom formatting for XML serialization and deserialization.
Public interface IXmlTextParser Infrastructure. Establishes a Normalized property for use by the .NET Framework infrastructure.
  Delegate Description
Public delegate UnreferencedObjectEventHandler Represents the method that handles the UnreferencedObject event of an XmlSerializer.
Public delegate XmlAttributeEventHandler Represents the method that handles the UnknownAttribute
Public delegate XmlElementEventHandler Represents the method that handles the UnknownElement event of an XmlSerializer.
Public delegate XmlNodeEventHandler Represents the method that handles the UnknownNode event of an XmlSerializer.
Public delegate XmlSerializationCollectionFixupCallback Infrastructure. Delegate used by the XmlSerializer class for deserialization of SOAP-encoded XML data types that map to collections or enumerations.
Public delegate XmlSerializationFixupCallback Infrastructure. Delegate used by the XmlSerializer class for deserialization of SOAP-encoded XML data.
Public delegate XmlSerializationReadCallback Infrastructure. Delegate used by the XmlSerializer class for deserialization of types from SOAP-encoded, non-root XML data.
Public delegate XmlSerializationWriteCallback Infrastructure. Delegate that is used by the XmlSerializer class for serialization of types from SOAP-encoded, non-root XML data.
  Enumeration Description
Public enumeration CodeGenerationOptions Specifies various options to use when generating .NET Framework types for use with an XML Web Service.
Public enumeration Supported by Portable Class Library XmlMappingAccess Infrastructure. Specifies whether a mapping is read, write, or both.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.