WsSetFaultErrorDetail function (webservices.h)

Write the fault detail stored in a WS_ERROR object.

Syntax

HRESULT WsSetFaultErrorDetail(
  [in] WS_ERROR                          *error,
  [in] const WS_FAULT_DETAIL_DESCRIPTION *faultDetailDescription,
  [in] WS_WRITE_OPTION                   writeOption,
       const void                        *value,
  [in] ULONG                             valueSize
);

Parameters

[in] error

The error object that will contain the fault information.

[in] faultDetailDescription

A pointer to a description of the fault detail.

If the action field of the fault detail description is non-NULL, then it is set as the WS_FAULT_ERROR_PROPERTY_ACTION of the WS_ERROR.

The element description of the fault detail description describes the format of the element in the fault detail.

[in] writeOption

Information about how the value is allocated. See WS_WRITE_OPTION for more information.

value

A pointer to the value to serialize.

[in] valueSize

The size of the value being serialized, in bytes.

If the value is NULL, then the size should be 0.

Return value

This function can return one of these values.

Return code Description
WS_E_INVALID_FORMAT
The input data was not in the expected format or did not have the expected value.
E_INVALIDARG
One or more arguments are invalid.
E_OUTOFMEMORY
Ran out of memory.

Remarks

This API will serialize the value of the detail field of the WS_FAULT stored in the WS_ERROR object.

This functions supports the following scenarios, based on the contents of the WS_ELEMENT_DESCRIPTION in the WS_FAULT_DETAIL_DESCRIPTION supplied:

  • Writing a single element. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to the local name and namespace of the element to write, and the type and type description represents the type of the value being serialized.
  • Writing multiple elements as a single value. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to NULL, and a WS_STRUCT_TYPE and WS_STRUCT_DESCRIPTION should be specified. Each field of the structure value being serialized should correspond to element(s) to write within the fault detail. The writeOption parameter must be either WS_WRITE_REQUIRED_VALUE or WS_WRITE_REQUIRED_POINTER.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll