Message.GetReaderAtBodyContents Message.GetReaderAtBodyContents Message.GetReaderAtBodyContents Message.GetReaderAtBodyContents Method


获取访问此消息正文内容的 XML 字典读取器。Gets the XML dictionary reader that accesses the body content of this message.

 System::Xml::XmlDictionaryReader ^ GetReaderAtBodyContents();
public System.Xml.XmlDictionaryReader GetReaderAtBodyContents ();
member this.GetReaderAtBodyContents : unit -> System.Xml.XmlDictionaryReader
Public Function GetReaderAtBodyContents () As XmlDictionaryReader


访问此消息正文内容的 XmlDictionaryReader 对象。A XmlDictionaryReader object that accesses the body content of this message.


消息为空,或已复制、读取或写入。The message is empty, or has been copied, read or written.


Message 实例的正文对应于 SOAP 正文。A Message instance has a body that corresponds to the SOAP body. 可通过调用 XmlDictionaryReaderGetReaderAtBodyContents 的形式来访问它。It can be accessed as an XmlDictionaryReader by calling GetReaderAtBodyContents. 它最初定位在紧靠 <S:Body> 元素后面的位置。It is initially positioned directly after the <S:Body> element. 或者,如果希望正文包含序列化对象,则可以改为调用 GetBodyAlternatively, if you expect the body to contain a serialized object, you can call GetBody instead. 应该注意,只能访问消息正文一次,并且只能写入消息一次。You should be aware that a message body can only be accessed once and a message can only be written once. 如果要访问正文多次,请使用 CreateBufferedCopy 创建 MessageBuffer 实例。If you want to access the body multiple times, use CreateBufferedCopy to create a MessageBuffer instance.