UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NC:webservices.WS_SERVICE_MESSAGE_RECEIVE_CALLBACK |
WS_SERVICE_MESSAGE_RECEIVE_CALLBACK (webservices.h) |
Invoked when a WS_MESSAGE is received on an endpoint configured with a WS_SERVICE_CONTRACT which has defaultMessageHandlerCallback set. |
|
wsw\ws_service_message_receive_callback.htm |
wsw |
2fcd8905-7002-41b8-b947-14d53c889c21 |
12/05/2018 |
WS_SERVICE_MESSAGE_RECEIVE_CALLBACK, WS_SERVICE_MESSAGE_RECEIVE_CALLBACK callback, WS_SERVICE_MESSAGE_RECEIVE_CALLBACK callback function [Web Services for Windows], webservices/WS_SERVICE_MESSAGE_RECEIVE_CALLBACK, wsw.ws_service_message_receive_callback |
webservices.h |
Windows |
Windows 7 [desktop apps \| UWP apps] |
Windows Server 2008 R2 [desktop apps \| UWP apps] |
Windows |
19H1 |
|
|
|
|
|
|
Invoked when a WS_MESSAGE is received on an endpoint configured with a WS_SERVICE_CONTRACT which has defaultMessageHandlerCallback set.
The incoming WS_MESSAGE, the serviceProxy along with other parameters is made available to the callback through WS_OPERATION_CONTEXT.
The context within which this callback is being invoked.
Specifies whether the callback can run asynchronously.
Specifies where additional error information should be stored if the function fails.
This callback function does not return a value.
When defined, callback would disallow all concurrency on a session based channel. If concurrency on a session based channel is desirable an application should not define WS_SERVICE_MESSAGE_RECEIVE_CALLBACK on the WS_SERVICE_CONTRACT.
At the time of the invocation of the callback, service model has performed WsReadMessageStart on the receiving WS_MESSAGE. It is the responsibility of the application implementing WS_SERVICE_MESSAGE_RECEIVE_CALLBACK to process the body and perform WsReadMessageEnd operation.
If the callback fails, the underlying channel is aborted.
See also, UnTypedServiceExample
Defining a WS_SERVICE_MESSAGE_RECEIVE_CALLBACK
// Method contract for the service
static WS_SERVICE_CONTRACT calculatorContract =
{
NULL,
NULL,
DefaultMessageHandlerCallback, // WS_SERVICE_MESSAGE_RECEIVE_CALLBACK
NULL
};
Accessing the incoming WS_MESSAGE property
HRESULT CALLBACK MessageRecieved(const WS_OPERATION_CONTEXT* context, const WS_ASYNC_CONTEXT* asyncContext, WS_ERROR* error)
{
:
hr = WsGetOperationContextProperty(context, WS_OPERATION_CONTEXT_PROPERTY_INPUT_MESSAGE, &requestMessage, sizeof(requestMessage), NULL, error);
:
}