WsCreateMessageForChannel function (webservices.h)

Creates a message for use with a specified channel.

Syntax

HRESULT WsCreateMessageForChannel(
  [in]           WS_CHANNEL                *channel,
                 const WS_MESSAGE_PROPERTY *properties,
  [in]           ULONG                     propertyCount,
                 WS_MESSAGE                **message,
  [in, optional] WS_ERROR                  *error
);

Parameters

[in] channel

Pointer to a WS_CHANNEL structure representing the channel 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 the 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

In contrast to the more general WsCreateMessage function, WsCreateMessageForChannel ensures that the message version used is appropriate 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