WebSphere Message Service Client for C/C++, Version 2.0.2 Operating Systems: AIX, Linux, Solaris, Windows

Map messages

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 it can 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. CONFIRM THAT WHOLE OF THIS APPLIES TO C/C++

When an application gets the value of a 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, 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.


Reference topic

Terms of Use | Rate this page

Last updated: 24 May 2011

(C) Copyright IBM Corporation 2005, 2011. All Rights Reserved.