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

ObjectMessage

An object message is a message whose body comprises a serialized Java or .NET object.

Related reference
Object messages

Functions

Summary of functions:
Function Description
xmsObjectMsgGetObjectAsBytes Get the object that forms the body of the object message.
xmsObjectMsgSetObjectAsBytes Set the object that forms the body of the object message.

xmsObjectMsgGetObjectAsBytes – Get Object as Bytes

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

Get the object that forms the body of the object message.

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

Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the object, which is returned as an array of bytes.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE instead, the object is not returned, but its length is returned in the actualLength parameter.
actualLength (output)
The length of the object in bytes. 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 object, XMS returns the object truncated to the length of the buffer, sets the actualLength parameter to the actual length of the object, and returns error code XMS_E_DATA_TRUNCATED.
  2. If any other error occurs while attempting to get the object, XMS reports the error but does not set the actualLength parameter.

xmsObjectMsgSetObjectAsBytes – Set Object as Bytes

Interface:
xmsRC xmsObjectMsgSetObjectAsBytes(xmsHMsg message,
                                   xmsSBYTE *value,
                                   xmsINT length,
                                   xmsHErrorBlock errorBlock);

Set the object that forms the body of the object message.

Parameters:
message (input)
The handle for the message.
value (input)
An array of bytes representing the object to be set.
length (input)
The number of bytes in the array.
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.