The body of a map message contains a set of name-value pairs, where each value has an associated data type.
In each name-value pair, the name is a string that identifies the value, and the value is an element of application data that has one of the XMS data types listed in Table 1. The order of the name-value pairs is not defined. The MapMessage class contains the methods to set and get name-value pairs.
An application can access a name-value pair randomly by specifying its name. Alternatively, a C or C++ application can access the name-value pairs sequentially using an iterator. The application can call the Get Name-Value Pairs method of the MapMessage class to create an iterator that encapsulates a list of Property objects, where each Property object encapsulates a name-value pair. The application can then use the methods of the Iterator class to retrieve each Property object in turn, and use the methods of the Property class to retrieve the name, data type, and value of each name-value pair. Although a name-value pair is not a property, the methods of the Property class treat a name-value pair like a property.
A .NET application can use the Get Map Names .NET property to get an enumeration of the names in the body of the map message.
When an application gets the value of name-value pair, the value can be converted by XMS into another data type. For example, to get an integer from the body of a map message, an application can call the Get String method of the MapMessage class, which returns the integer as a string. The supported conversions are the same as those that are supported when XMS converts a property value from one data type to another. For more information about the supported conversions, therefore, see Implicit conversion of a property value from one data type to another.
After an application creates a map message, the body of the message is readable and writable. The body remains readable and writable after the application sends the message. When an application receives a map message, the body of the message is read-only. If an application calls the Clear Body method of the Message class when the body of a map message is read-only, the body becomes readable and writable. The method also clears the body.