WSDGenerateFaultEx function (wsdutil.h)

Generates a SOAP fault.

Syntax

HRESULT WSDGenerateFaultEx(
  [in]  WSDXML_NAME               *pCode,
  [in]  WSDXML_NAME               *pSubCode,
  [in]  WSD_LOCALIZED_STRING_LIST *pReasons,
  [in]  LPCWSTR                   pszDetail,
  [out] WSD_SOAP_FAULT            **ppFault
);

Parameters

[in] pCode

A SOAP fault code.

The list of possible fault codes follows. For a description of each fault code, see the

SOAP Version 1.2 specification.

VersionMismatch

MustUnderstand

DataEncodingUnknown

Sender

Receiver

[in] pSubCode

A fault subcode.

[in] pReasons

A WSD_LOCALIZED_STRING_LIST structure that contains a list of localized reason codes.

[in] pszDetail

Contains application-specific error information pertaining to the fault.

[out] ppFault

A WSD_SOAP_FAULT structure that contains the generated fault. ppFault must be freed with a call to WSDFreeLinkedMemory.

Return value

Possible return values include, but are not limited to, the following:

Return code Description
S_OK
Method completed successfully.
E_INVALIDARG
pszCode or pReasons is NULL.
E_POINTER
ppFault is NULL.

Remarks

SOAP faults provide a way to communicate error information on failed SOAP messages. Different Web Services protocols extend faults to provide contextual error information, and in some cases, like in WS-Eventing, faults are an expected part of specific message patterns as the client determines whether or not the device supports specific features.

The following fault subcodes are not implemented by WSDAPI:

  • InvalidMessageInformationHeader
  • MessageInformationHeaderRequired
  • UnsupportedExpirationType
  • InvalidMessage
  • FilteringNotSupported

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wsdutil.h (include Wsdapi.h)
Library Wsdapi.lib
DLL Wsdapi.dll