Message.AddStringAsXml

Method

Visual Basic

Overloads Public Sub AddStringAsXml(
    ByVal fieldName As String,
    ByVal fieldValue As String)
Overloads Public Sub AddStringAsXml(
    ByVal messageField As MessageField,
    ByVal fieldValue As String,
    ByVal fieldId As UInt16)

C#

public void AddStringAsXml(
    string fieldName,
    string fieldValue);
public void AddStringAsXml(
    string fieldName,
    string fieldValue,
    ushort fieldId);

Purpose

Add a string to a message as the value of an XML field (without parsing it to verify that it specifies a well-formed XML document).

Remarks

When creating an XmlDocument object, .NET parses the data to verify that it specifies well-formed XML. Because such parsing is occasionally inappropriate, this method lets you add XML string data directly into an XML field, compressing its data, without incurring the overhead of parsing the XML string.

Overloading

This method has two overloads. Message.AddStringAsXml Overloads describes their behavior.

Message.AddStringAsXml Overloads

Signature

Description

fieldName,fieldValue

The overload with two parameters adds a field without an identifier.

The first parameter specifies the name of the new field. Fields without identifiers must have non-null names.

The second parameter specifies the data.

fieldName,fieldValue,fieldId

The overload with three parameters adds a field with an identifier.

The first parameter specifies the name of the new field. A field with an identifier may have a null name.

The second parameter specifies the data.

The third parameter specifies the field identifier. All field identifiers must be unique within each message. Integers in the range [1, 65535] are valid arguments for this parameter.

See Also

Message.GetXmlAsString