WebSphere Message Service Clients for C/C++ and .NET, Version 1.2 Operating Systems: Linux, Windows

TextMessage

A text message is a message whose body comprises a string.

Related reference
Text messages

Functions

Summary of functions:
Function Description
xmsTextMsgGetText Get the string that forms the body of the text message.
xmsTextMsgSetText Set the string that forms the body of the text message.

xmsTextMsgGetText – Get Text

Interface:
xmsRC xmsTextMsgGetText(xmsHMsg message,
                        xmsCHAR *buffer,
                        xmsINT bufferLength,
                        xmsINT *actualLength,
                        xmsHErrorBlock errorBlock);

Get the string that forms the body of the text message. If required, XMS converts the characters in the string into the local code page.

For more information about how to use this function, see C functions that return a string by value.

Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the string. If data conversion is required, this is the string after conversion.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE instead, the string is not returned, but its length is returned in the actualLength parameter.
actualLength (output)
The length of the string in bytes. If data conversion is required, this is the length of the string after conversion. If you specify a null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
  • XMS_X_MESSAGE_EOF_EXCEPTION
Notes:
  1. If the buffer is not large enough to store the whole string, XMS returns the string truncated to the length of the buffer, sets the actualLength parameter to the actual length of the string, and returns error code XMS_E_DATA_TRUNCATED.
  2. If any other error occurs while attempting to get the string, XMS reports the error but does not set the actualLength parameter.

xmsTextMsgSetText – Set Text

Interface:
xmsRC xmsTextMsgSetText(xmsHMsg message,
                        xmsCHAR *value,
                        xmsINT length,
                        xmsHErrorBlock errorBlock);

Set the string that forms the body of the text message.

Parameters:
message (input)
The handle for the message.
value (input)
A character array containing the string to be set.
length (input)
The length of the string in bytes. If the string is null terminated with no embedded null characters, you can specify XMSC_CALCULATE_STRING_SIZE instead and allow XMS to calculate its length.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION

Reference topic

Terms of Use | Rate this page

Last updated: 7 Dec 2005

© Copyright IBM Corporation 2005. All Rights Reserved.