WsRemoveCustomHeader function (webservices.h)

Removes a custom header from the message.

This function is designed to handle types of headers that appear once in the message and are targeted at the ultimate receiver. Headers targeted with a role other than ultimate receiver are ignored.

Syntax

HRESULT WsRemoveCustomHeader(
  [in]           WS_MESSAGE          *message,
  [in]           const WS_XML_STRING *headerName,
  [in]           const WS_XML_STRING *headerNs,
  [in, optional] WS_ERROR            *error
);

Parameters

[in] message

A pointer to the Message object with the header to be removed.

The message can be in any state except WS_MESSAGE_STATE_EMPTY.

[in] headerName

A pointer to the WS_XML_STRING object that references the "local name" of the header element to be removed.

[in] headerNs

A pointer to the WS_XML_STRING object that references the namespace of the header element to be removed.

[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_E_INVALID_FORMAT
There are multiple instances of the type of header present in the message.
E_OUTOFMEMORY
There was not enough memory available to serialize the header.
E_INVALIDARG
One or more of the parameters are incorrect.
Other Errors
This function may return other errors not listed above.

Remarks

If a header of the given type exists in the message it is removed. If the header does not exist, the function takes no action and completes successfully.

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