<?xml version="1.0"?>
<OrderedItem xmlns:inventory="http://www.cpandl.com" xmlns:money="http://www.cohowinery.com">
<inventory:ItemName>Widget</inventory:ItemName>
<inventory:Description>Regular Widget</inventory:Description>
<money:UnitPrice>2.3</money:UnitPrice>
<inventory:Quantity>10</inventory:Quantity>
<money:LineTotal>23</money:LineTotal>
</OrderedItem>
反序列化是读取 XML 文档的实例并构造一个对象的过程,该对象被强类型化为文档的 XML 架构 (XSD) 。
在反序列化之前,
XmlSerializer
必须使用正在反序列化的对象的类型构造 。
自动
XmlReader
检测并使用 XML 文档指定的编码。
无法
XmlSerializer
反序列化以下内容:的
ArrayList
数组和 的
List<T>
数组。
public:
System::Object ^ Deserialize(System::Xml::XmlReader ^ xmlReader, System::String ^ encodingStyle);
public object? Deserialize (System.Xml.XmlReader xmlReader, string? encodingStyle);
public object Deserialize (System.Xml.XmlReader xmlReader, string encodingStyle);
member this.Deserialize : System.Xml.XmlReader * string -> obj
Public Function Deserialize (xmlReader As XmlReader, encodingStyle As String) As Object
反序列化是读取 XML 文档的实例并构造一个对象的过程,该对象被强类型化为文档的 XML 架构 (XSD) 。
在反序列化之前,
XmlSerializer
必须使用正在反序列化的对象的类型构造 。
encodingStyle
对于 SOAP 版本 1.1 编码,将 参数设置为“
http://schemas.xmlsoap.org/soap/encoding/
”;否则,对于 SOAP 1.2 版编码,将其设置为“
http://www.w3.org/2001/12/soap-encoding
”。
注意
无法
XmlSerializer
反序列化以下内容:的
ArrayList
数组和 的
List<T>
数组。
public:
System::Object ^ Deserialize(System::Xml::XmlReader ^ xmlReader, System::Xml::Serialization::XmlDeserializationEvents events);
public object? Deserialize (System.Xml.XmlReader xmlReader, System.Xml.Serialization.XmlDeserializationEvents events);
public object Deserialize (System.Xml.XmlReader xmlReader, System.Xml.Serialization.XmlDeserializationEvents events);
member this.Deserialize : System.Xml.XmlReader * System.Xml.Serialization.XmlDeserializationEvents -> obj
Public Function Deserialize (xmlReader As XmlReader, events As XmlDeserializationEvents) As Object
public:
System::Object ^ Deserialize(System::Xml::XmlReader ^ xmlReader, System::String ^ encodingStyle, System::Xml::Serialization::XmlDeserializationEvents events);
public object? Deserialize (System.Xml.XmlReader xmlReader, string? encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events);
public object Deserialize (System.Xml.XmlReader xmlReader, string encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events);
member this.Deserialize : System.Xml.XmlReader * string * System.Xml.Serialization.XmlDeserializationEvents -> obj
Public Function Deserialize (xmlReader As XmlReader, encodingStyle As String, events As XmlDeserializationEvents) As Object