System.Xml.Serialization.SoapAttributeOverrides Class

Allows you to override attributes applied to properties, fields, and classes when you use an System.Xml.Serialization.XmlSerializer to serialize or deserialize an object as encoded SOAP.

See Also: SoapAttributeOverrides Members

Syntax

public class SoapAttributeOverrides

Remarks

The System.Xml.Serialization.SoapAttributeOverrides class enables an System.Xml.Serialization.XmlSerializer to override the default way of serializing a set of objects. Overriding serialization in this way has two uses: first, you can control and augment the serialization of objects found in a DLL, even if you do not have access to the source; second, you can create one set of serializable classes, but serialize the objects in multiple ways. For example, instead of serializing members of a class instance as XML elements, you can serialize them as XML attributes, resulting in a more efficient document to transport.

After you create a System.Xml.Serialization.SoapAttributeOverrides, you create an System.Xml.Serialization.XmlTypeMapping using the SoapReflectionImporter.ImportTypeMapping(Type) method of the System.Xml.Serialization.SoapReflectionImporter class. Pass the resulting object as an argument to the XmlSerializer.#ctor constructor. The resulting System.Xml.Serialization.XmlSerializer uses the data contained by the System.Xml.Serialization.SoapAttributeOverrides to override attributes that control how objects are serialized. To accomplish this, the System.Xml.Serialization.SoapAttributeOverrides contains a collection of the object types that are overridden, as well as a System.Xml.Serialization.SoapAttributes associated with each overridden object type. Each System.Xml.Serialization.SoapAttributes contains an appropriate set of attribute objects that control how each field, property, or class is serialized.

The process for creating and using a System.Xml.Serialization.SoapAttributeOverrides is as follows:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0