WsSendReplyMessage function (webservices.h)

Sends a message which is a reply to a received message.

Syntax

HRESULT WsSendReplyMessage(
  [in]           WS_CHANNEL                   *channel,
  [in]           WS_MESSAGE                   *replyMessage,
  [in]           const WS_MESSAGE_DESCRIPTION *replyMessageDescription,
  [in]           WS_WRITE_OPTION              writeOption,
                 const void                   *replyBodyValue,
  [in]           ULONG                        replyBodyValueSize,
  [in]           WS_MESSAGE                   *requestMessage,
  [in, optional] const WS_ASYNC_CONTEXT       *asyncContext,
  [in, optional] WS_ERROR                     *error
);

Parameters

[in] channel

A pointer to the Channel object on which to send the reply Message. The pointer must reference a valid WS_CHANNEL object.

[in] replyMessage

A pointer to the Message object for sending the reply. The pointer must reference a valid WS_MESSAGE object.

Message object state must be set to WS_MESSAGE_STATE_EMPTY or WS_MESSAGE_STATE_INITIALIZED.

Note  If an initialized message is provided it must be initialized using WS_REPLY_MESSAGE or WS_FAULT_MESSAGE.
 

[in] replyMessageDescription

A pointer to a WS_MESSAGE_DESCRIPTION object. The action field of WS_MESSAGE_DESCRIPTION is used as the action header for the reply message. This field can be NULL if no action is required.

The bodyElementDescription field of the WS_MESSAGE_DESCRIPTION is used to serialize the body of the reply message. This field may be NULL if no body element is desired. See WsWriteBody for information about how the bodyElementDescription is used to serialize a value.

[in] writeOption

Determines whether the body element is required, and how the value is allocated.

See WS_WRITE_OPTION for more information.

replyBodyValue

A void pointer to the value to serialize in the reply message.

[in] replyBodyValueSize

The size in bytes of the reply value being serialized.

[in] requestMessage

A pointer to a WS_MESSAGE object encapsulating the request message text. This is used to obtain correlation information used in formulating the reply message.

Note  The message can be in any state except WS_MESSAGE_STATE_EMPTY.
 

[in, optional] asyncContext

A pointer to a WS_ASYNC_CONTEXT data structure with information about invoking the function asynchronously. A NULL value indicates a request for synchronous operation.

[in, optional] error

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

Return value

This function can return one of these values.

Return code Description
WS_S_ASYNC
The asynchronous operation is still pending.
WS_E_OPERATION_ABORTED
The operation was aborted.
WS_E_INVALID_OPERATION
The operation is not allowed due to the current state of the object.
WS_E_ENDPOINT_DISCONNECTED
The connection with the remote endpoint was terminated.
WS_E_INVALID_FORMAT
The input data was not in the expected format or did not have the expected value.
WS_E_OPERATION_TIMED_OUT
The operation did not complete within the time allotted.
WS_E_QUOTA_EXCEEDED
A quota was exceeded.
WS_E_SECURITY_VERIFICATION_FAILURE
Security verification was not successful for the received data.
WS_E_SECURITY_SYSTEM_FAILURE
A security operation failed in the Windows Web Services framework.
WS_E_SECURITY_TOKEN_EXPIRED
A security token was rejected by the server because it has expired.
E_OUTOFMEMORY
Ran out of memory.
E_INVALIDARG
One or more arguments are invalid.
Other Errors
This function may return other errors not listed above.

Remarks

The reply message will including correlation information as appropriate to the WS_ADDRESSING_VERSION. See Channel Layer Overview for more information about correlating request reply messages.

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