System.Xml.Serialization.XmlSerializationReader.UnreferencedObject Method

Raises an XmlSerializer.UnreferencedObject event for the current position of the System.Xml.XmlReader.

Syntax

protected void UnreferencedObject (string id, object o)

Parameters

id
A unique string that is used to identify the unreferenced object, subsequently accessible through the UnreferencedObjectEventArgs.UnreferencedId property.
o
An object that the System.Xml.Serialization.XmlSerializer is attempting to deserialize, subsequently accessible through the UnreferencedObjectEventArgs.UnreferencedObject property.

Remarks

The protected members of System.Xml.Serialization.XmlSerializationReader are intended for use only by derived classes that are used internally within the .NET Framework XML serialization infrastructure.

SOAP encoding, as specified in Section 5 of the SOAP 1.1 specification, allows for elements referenced multiple times in a SOAP message (or optionally, just once) to be referred by an href attribute in the main message. An XmlSerializer.UnreferencedObject event occurs when such an element appears, but there is no href reference to it.

Add a handler method to XmlSerializer.UnreferencedObject to provide custom handling for unreferenced objects while the System.Xml.Serialization.XmlSerializer executes its erload:System.Xml.Serialization.XmlSerializer.Deserialize method.

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