This documentation is archived and is not being maintained.

XmlSerializableServices Class

Contains methods for reading and writing XML.


Namespace:  System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public static class XmlSerializableServices

The XmlSerializableServices type exposes the following members.

Public methodStatic memberAddDefaultSchemaGenerates a default schema type given the specified type name and adds it to the specified schema set.
Public methodStatic memberReadNodesReads a set of XML nodes from the specified reader and returns the result.
Public methodStatic memberWriteNodesWrites the supplied nodes using the specified writer.

Using , you can generate CLR types representing data contracts from XML schemas. In certain cases when doing so, the schemas may not all be represented as data contracts. In this case, you can use the ImportXmlType property of the ImportOptions class. Setting the property to true specifies that these types are imported as XML types that implement the IXmlSerializable interface. In the process, the generated types can store anything, but they are read and written as XML by the serializer.

The XmlSerializableServices is an abstract helper class that contains code that is used by the generated IXmlSerializable types to read and write XML. It also contains code for generating schema for the generated types. Note that details about the schemas are not stored. Only the name is stored in the generated type. This class generates a default schema that represents the XML schema type anyType with the appropriate schema type name as the contract name.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.