WsCreateMessage function (webservices.h)

Creates a message object with the specified properties.

Syntax

HRESULT WsCreateMessage(
  [in]           WS_ENVELOPE_VERSION       envelopeVersion,
  [in]           WS_ADDRESSING_VERSION     addressingVersion,
                 const WS_MESSAGE_PROPERTY *properties,
  [in]           ULONG                     propertyCount,
                 WS_MESSAGE                **message,
  [in, optional] WS_ERROR                  *error
);

Parameters

[in] envelopeVersion

A WS_ENVELOPE_VERSION enumeration value that specifies the version of the envelope for the message.

[in] addressingVersion

A WS_ADDRESSING_VERSION that specifies the version of the addressing for the message.

properties

An array of optional properties for the message. See WS_MESSAGE_PROPERTY.

The value of this parameter may be NULL, in which case, the propertyCount parameter must be 0 (zero).

[in] propertyCount

The number of properties in the properties array.

message

On success, a pointer that receives the address of a WS_MESSAGE structure representing the new message.

When you no longer need this structure, you must free it by calling WsFreeMessage.

[in, optional] error

Pointer to a WS_ERROR structure that receives additional error information if the function fails.

Return value

If the function succeeds, it returns NO_ERROR; otherwise, it returns an HRESULT error code.

Return code Description
E_OUTOFMEMORY
Insufficient memory to complete the operation.
E_INVALIDARG
One or more arguments are invalid.
Other Errors
This function may return other errors not listed above.

Remarks

A message object is the delivery vehicle for Windows Web Services. A single message object can be used to send or receive sequential messages. Reusing a message object in this way can reduce memory allocations. When you no longer need the message, you must free the memory by calling WsFreeMessage. (For more information on reusing message objects, see WsResetMessage .)

If you are creating a message for use with a particular channel, use the WsCreateMessageForChannel function, which will ensure the correct message version for the channel.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll