WS_READ_TYPE_CALLBACK callback function (webservices.h)

Reads a value when WS_TYPE has been specified. This allows reading of XML constructs which do not easily map to the core serialization model.

Syntax

WS_READ_TYPE_CALLBACK WsReadTypeCallback;

HRESULT WsReadTypeCallback(
  [in]           WS_XML_READER *reader,
  [in]           WS_TYPE_MAPPING typeMapping,
  [in]           const void *descriptionData,
  [in, optional] WS_HEAP *heap,
                 void *value,
  [in]           ULONG valueSize,
  [in, optional] WS_ERROR *error
)
{...}

Parameters

[in] reader

A pointer to a WS_XML_READER handle that contains the type value.

[in] typeMapping

Indicates how the XML is being mapped to this type.

If a mapping does not make sense for this particular type, then the callback should return WS_E_INVALID_OPERATION. (See Windows Web Services Return Values.) A callback implementation should be prepared to be passed new mapping types in future versions and should return WS_E_INVALID_OPERATION for those cases.

[in] descriptionData

A pointer to the value of the descriptionData field of a WS_CUSTOM_TYPE_DESCRIPTION structure. The callback can use this to gain access to any additional information about the type.

[in, optional] heap

A pointer to the heap for use in allocating any additional data associated with this type such as its nested fields.

Note that this parameter may be NULL, if the caller did not specify a WS_HEAP object when deserializing the type.

value

A pointer to a buffer that holds the value that is being deserialized. The callback is responsible for filling in the value based on the current contents of the reader and the typeMapping. The callback can use the supplied heap if necessary to allocate values associated with the value.

[in] valueSize

The buffer size that is being deserialized. The buffer is allocated according to the size specified in the WS_CUSTOM_TYPE_DESCRIPTION.

[in, optional] error

A pointer to WS_ERROR data structure where additional error information should be stored if the function fails.

Return value

This callback function does not return a value.

Remarks

The callback will be invoked with the same calling sequence as WsReadType in the documentation for WS_TYPE_MAPPING. This defines what parts of the XML that the callback should read.

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