WS_ENCODER_GET_CONTENT_TYPE_CALLBACK callback function (webservices.h)

Gets the content type of the message.

Syntax

WS_ENCODER_GET_CONTENT_TYPE_CALLBACK WsEncoderGetContentTypeCallback;

HRESULT WsEncoderGetContentTypeCallback(
  void *encoderContext,
  const WS_STRING *contentType,
  WS_STRING *newContentType,
  WS_STRING *contentEncoding,
  WS_ERROR *error
)
{...}

Parameters

encoderContext

The encoder instance returned by the WS_CREATE_ENCODER_CALLBACK.

contentType

The content type of the encoded message.

newContentType

The callback should return the content type for the newly encoded message here.

contentEncoding

The callback should return the content encoding for the encoded message here.

error

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

Return value

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 callback may inspect the content type provided, and then should return the content type to use for the encoded message.

The content type and content encoding returned must remain valid until the callback is invoked again, or the encoder is freed.

For WS_HTTP_CHANNEL_BINDING, if a non-zero length content encoding is returned, the HTTP header "Content-Encoding" will be added to the message with this value.

For other channel bindings, it is an error to return a non-zero length content encoding.

Requirements

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