System.Xml.Serialization.XmlIncludeAttribute Class

Allows the System.Xml.Serialization.XmlSerializer to recognize a type when it serializes or deserializes an object.

See Also: XmlIncludeAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Method | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=true)]
public class XmlIncludeAttribute : Attribute

Remarks

Use the System.Xml.Serialization.XmlIncludeAttribute when you call the XmlSerializer.Serialize(System.IO.TextWriter, object) or XmlSerializer.Deserialize(System.IO.Stream) method of the System.Xml.Serialization.XmlSerializer class.

When applying the System.Xml.Serialization.XmlIncludeAttribute, specify the Type of the derived class. When the System.Xml.Serialization.XmlSerializer serializes objects that include both the base and the derived class, it can then recognize both object types.

You can use the System.Xml.Serialization.XmlIncludeAttribute to include derived classes in service description documents that are written in the Web Services Description Language (WSDL). For example, if a method returns an object, apply the System.Xml.Serialization.XmlIncludeAttribute to the method and specify the actual types to return.

For more information on the WSDL, see "Web Services Description Language (WSDL) 1.1" at www.w3.org.

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