HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
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 ExceptionInfo &eInfo)
 
 Exception (const char *msg)
 
 Exception (const std::string &msg)
 
 Exception (const rwsf::ExceptionInfo &eInfo, const LocalizedMessage &msg)
 
 Exception (const Exception &)
 
virtual ~Exception () throw ()
 
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 throw ()
 

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;
}
}

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

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

Returns the fault object as a SoapFault.

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.