WS_IS_DEFAULT_VALUE_CALLBACK callback function (webservices.h)

Determines if a value is the default value. This callback is used before a value that is handled by a WS_CUSTOM_TYPE is serialized. Support for default values is enabled by specifying when WS_FIELD_OPTIONAL in the WS_FIELD_DESCRIPTION.

Syntax

WS_IS_DEFAULT_VALUE_CALLBACK WsIsDefaultValueCallback;

HRESULT WsIsDefaultValueCallback(
  [in]           const void *descriptionData,
                 const void *value,
                 const void *defaultValue,
  [in]           ULONG valueSize,
  [out]          BOOL *isDefault,
  [in, optional] WS_ERROR *error
)
{...}

Parameters

[in] descriptionData

This is the value of the descriptionData field from WS_CUSTOM_TYPE_DESCRIPTION. The callback can use this to access any additional information about the type.

value

A pointer to the value being serialized.

defaultValue

A pointer to the default value. If no default value was specified for the field, this parameter will be NULL.

If the parameter is non-NULL, the callback should compare the two values field-by-field according to the custom type. If the fields match, then the isDefault parameter should be set to TRUE.

If the parameter is NULL, the callback should compare the fields of the value with zero. If the fields match, then the isDefault parameter should be set to TRUE.

[in] valueSize

The size, in bytes, of the value being serialized.

[out] isDefault

Whether or not the value is the default value.

[in, optional] error

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

Return value

This callback function does not return a value.

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