HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::SoapFaultException Class Reference

Represents generic SOAP faults in the generated client proxy. More...

#include <rwsf/webservice/SoapFault.h>

Inheritance diagram for rwsf::SoapFaultException:
rwsf::Exception

Public Member Functions

 SoapFaultException (const rwsf::SoapFault &fault)
rwsf::SoapFault getFault () const
Public Member Functions inherited from rwsf::Exception
 Exception (const char *msg)
 Exception (const Exception &)
 Exception (const ExceptionInfo &eInfo)
 Exception (const rwsf::ExceptionInfo &eInfo, const LocalizedMessage &msg)
 Exception (const std::string &msg)
virtual ~Exception () noexcept
virtual Exceptionclone (void) const
const char * getFileName () const
const char * getFunctionName () const
unsigned long getLineNumber () const
virtual bool operator!= (const Exception exc2)
Exceptionoperator= (const Exception &m)
virtual bool operator== (const Exception exc2)
virtual void raise (void) const
virtual const char * what () const noexcept

Additional Inherited Members

Detailed Description

rwsf::SoapFaultException represents generic SOAP faults in the proxy. If a fault is defined in the WSDL, a special class is generated for it; if it is not defined, an instance of rwsf::SoapFaultException is thrown from the client.

You may request the fault message as an std::string using what() . Alternatively, you can retrieve the SoapFault object using the getFault() method. The SoapFault object has methods for retrieving individual parts of the fault, such as the fault code and the fault detail. See rwsf::SoapFault for more information.

For an example on how generic and specific faults are caught, run the Fault example in your installdir\examples\webservices\Fault directory.

The following code shows how a generated client implementation catches a rwsf::SoapFaultException in its invoke() methods. This excerpt is from the generated client for the DayofWeek example in your installdir\examples\webservices\DayofWeek directory.

void invoke_getDayOfWeek(DayOfWeekBindingProxy& proxy)
{
RWDate date_in;
RWCString dayOfWeek_ret;
rwsf::CallInfo callInfo;
try {
dayOfWeek_ret = proxy.getDayOfWeek(callInfo, date_in);
} catch(const rwsf::SoapFaultException& e) {
std::cout << "Fault Code: "
<< e.getFault().getFaultcode().asString() << std::endl;
std::cout << "Fault String: "
<< e.getFault().getFaultstring() << std::endl;
}
}
Holds all data for a given message, such as session or transaction data, SOAP headers,...
Definition CallInfo.h:75
Represents generic SOAP faults in the generated client proxy.
Definition SoapFault.h:270
rwsf::SoapFault getFault() const
std::string getFaultstring() const
rwsf::XmlName getFaultcode() const
std::string asString() const

For more information on faults and exception handling, see the Web Service Development Guide.

Constructor & Destructor Documentation

◆ SoapFaultException()

rwsf::SoapFaultException::SoapFaultException ( const rwsf::SoapFault & fault)

Initializes an rwsf::SoapFaultException with the given SoapFault fault.

Member Function Documentation

◆ getFault()

rwsf::SoapFault rwsf::SoapFaultException::getFault ( ) const

Returns the fault object as a SoapFault.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.