WS_CREATE_DECODER_CALLBACK callback function (webservices.h)

Handles creating a decoder instance.

Syntax

WS_CREATE_DECODER_CALLBACK WsCreateDecoderCallback;

HRESULT WsCreateDecoderCallback(
  [in]           void *createContext,
  [in]           WS_READ_CALLBACK readCallback,
  [in]           void *readContext,
                 void **decoderContext,
  [in, optional] WS_ERROR *error
)
{...}

Parameters

[in] createContext

The createContext that was specified in the WS_CHANNEL_DECODER used during channel creation.

[in] readCallback

The function that should be used to read the message data. This callback should only be used in response to the WS_DECODER_START_CALLBACK, WS_DECODER_DECODE_CALLBACK and WS_DECODER_END_CALLBACK callbacks.

[in] readContext

The read context that should be passed to the provided WS_READ_CALLBACK.

decoderContext

Returns the decoder instance. This value will be passed to all of the decoder callbacks.

[in, optional] error

Specifies where additional error information should be stored if the function fails.

Return value

This callback function can return one of these values.

Return code Description
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 channel will create decoder instances as necessary. Each decoder instance will be called in a single-threaded fashion. A single decoder instance however should not assume that it will see all messages from a channel, as the channel may use multiple decoder instances for processing messages.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header webservices.h