Share via


startFault, endFault, startFaultDetail, and endFaultDetail Methods

These methods build a <Fault> element in a SOAP message.

These four methods work together in the following way:

  • The startFault method begins a <Fault> element in the SOAP message.
  • The startFaultDetail method begins a <detail> element within the <Fault> element.
  • The endFaultDetail method ends a <detail>element within the <Fault> element.
  • The endFault method ends the <Fault> element.

The server only builds a <Fault> element if there is an error in processing a SOAP request. The server adds the <Fault> element to the <Body> element of a SOAP message and returns this appended message to the client.

HRESULT startFault( 
  BSTR faultcode, 
  BSTR faultstring, 
  BSTR faultactor, 
  BSTR faultcodeNS 
);

HRESULT startFaultDetail(
  BSTR enc_style_uri 
);

HRESULT endFaultDetail (void);
HRESULT endFault (void);

Parameters

  • faultcode
    [in] Value of the <faultcode> element.
  • faultstring
    [in] Value of the <faultstring> element.
  • faultactor
    [in] Optional. Default value is "". The value of the <faultactor> element. If the parameter is omitted or is an empty string, the <Fault> does not include a <faultactor> element.
  • faultcodeNS
    [in] Optional. Default value is "". Provides the namespace for faultcode. Sets the namespace to "https://schemas.xmlsoap.org/soap.envelope/" if faultcodeNS is NULL.
  • enc_style_uri
    [in] Optional. default value is "NONE". The Universal Resource Identifier (URI) for the encodingStyle attribute of the <Detail> element. The following values have special meaning when assigned to this parameter:
    Value Description
    NONE Default. Use this value if you do not want encodingStyle attribute generated in <Detail> element.
    STANDARD Use this value if you want to generate encodingStyle attribute with the default encoding style in the <Detail> element.

Return Values

The following table describes the common return values.

Value Description
S_OK Success.
E_NOTIMPL The function contains no implementation.
E_OUTOFMEMORY Out of memory.

Remarks

For additional information on setting encoding style, see startEnvelope and endEnvelope Methods.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Mssoap.h.
Link Library: Uuid.lib.

See Also

ISoapSerializer

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.