Message.GetXmlAsString

Method

Visual Basic

Overloads Public Function GetXmlAsString(
    ByVal fieldName As String)
Overloads Public Function GetXmlAsString(
    ByVal fieldName As String,
    ByVal fieldId As UInt16)
Public Function GetXmlAsStringByIndex(
    ByVal fieldIndex As UInt32
) As String

C#

public String GetXmlAsString(
    string fieldName);
public String GetXmlAsString(
    string fieldName,
    ushort fieldId);
public String GetXmlAsStringByIndex(
    uint fieldIndex)

Purpose

Get an XML field from a message, and return its value as a string (without parsing to verify that it specifies a well-formed XML document).

Remarks

When Message.GetField gets the value of an XML field, it creates an XmlDocument data object; in the process, .NET parses the data to verify that it specifies well-formed XML. Because such parsing is occasionally inappropriate, this method gets an XML field, uncompresses its data, and returns it as a string—without parsing it.

The semantics of finding a field within a message are identical to the method Message.GetField; for a complete description, see Field Search Algorithm.

fieldName

Get a field with this name.

fieldId

Get the field with this identifier.

The constant MessageField.NoSpecificId (zero) is a special value; it indicates the absence of any identifier to the field search algorithm.

fieldIndex

Get the field with this index. Zero specifies the first field.

See also Message.GetFieldByIndex.

See Also

Message.AddStringAsXml