WsReadMessageStart function (webservices.h)
Read the headers of the next message from the channel, and prepare to read the body elements.
Syntax
HRESULT WsReadMessageStart(
[in] WS_CHANNEL *channel,
[in] WS_MESSAGE *message,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] channel
The channel to receive from.
[in] message
The message to receive into.
[in, optional] asyncContext
Information on how to invoke the function asynchronously, or NULL if invoking synchronously.
[in, optional] error
Specifies where additional error information should be stored if the function fails.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
Start of message was received successfully. |
|
There are no more messages available on the channel. |
|
The asynchronous operation is still pending. |
|
The operation was aborted. |
|
The operation is not allowed due to the current state of the object. |
|
The remote endpoint does not exist or could not be located. |
|
Access was denied by the remote endpoint. |
|
The connection with the remote endpoint was terminated. |
|
The remote endpoint could not process the request. |
|
The remote endpoint is not currently in service at this location. |
|
The remote endpoint is unable to process the request due to being overloaded. |
|
The remote endpoint was not reachable. |
|
The endpoint address URL is invalid. |
|
The input data was not in the expected format or did not have the expected value. |
|
The operation did not complete within the time allotted. |
|
Access was denied by the HTTP proxy server. |
|
The HTTP proxy server could not process the request. |
|
A quota was exceeded. |
|
Security verification was not successful for the received data. |
|
A security operation failed in the Windows Web Services framework. |
|
A security token was rejected by the server because it has expired. |
|
The HTTP proxy server requires HTTP authentication scheme 'basic'. |
|
The HTTP proxy server requires HTTP authentication scheme 'digest'. |
|
The HTTP proxy server requires HTTP authentication scheme 'negotiate'. |
|
The HTTP proxy server requires HTTP authentication scheme 'NTLM'. |
|
The remote endpoint requires HTTP authentication scheme 'basic'. |
|
The remote endpoint requires HTTP authentication scheme 'digest'. |
|
The remote endpoint requires HTTP authentication scheme 'negotiate'. |
|
The remote endpoint requires HTTP authentication scheme 'NTLM'. |
|
A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file. |
|
The certificates CN name does not match the passed value. |
|
A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider. |
|
The certificate is not valid for the requested usage. |
|
The revocation function was unable to check revocation because the revocation server was offline. |
|
Ran out of memory. |
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
This reads the start of the next message from the channel, including the headers of the message.
This function is like WsReadEnvelopeStart but is used with channels.
Upon success, the headers will be stored in the message and can be accessed in a random-access fashion (for example, using WsGetHeader).
The message must be in WS_MESSAGE_STATE_EMPTY state. Upon success, the message will have transitioned to WS_MESSAGE_STATE_READING state.
To deserialize an element of the message body, use WsReadBody. To read directly from the XML Reader of the message, first get the reader using the WS_MESSAGE_PROPERTY_BODY_READER property.
If the channel input is streamed (WS_STREAMED_INPUT_TRANSFER_MODE), then WsFillBody must be called to receive the next part of the body before it is actually read.
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 |