HydraExpress™ C++ 2020 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Represents SOAP faults through its derived classes ClientFault and ServerFault. More...
#include <rwsf/webservice/Fault.h>
Public Types | |
enum | EncodingStyle { Rpc, Document, Wrapped } |
enum | FaultCode { VersionMismatch, MustUnderstand, Client, Server } |
Public Member Functions | |
Fault () | |
Fault (FaultCode faultCode, const std::string &faultString) | |
virtual | ~Fault () throw () |
std::string | asString () const |
EncodingStyle | getEncodingStyle () const |
Fault::FaultCode | getFaultCode () const |
std::string | getFaultCodeAsString () const |
std::string | getFaultString () const |
std::string | getProperty (const std::string &key) const |
virtual void | init (const rwsf::Config &initParams) |
void | setEncodingStyle (EncodingStyle style) |
void | setFaultCode (Fault::FaultCode faultCode) |
void | setFaultString (const std::string &faultString) |
void | setProperty (const std::string &key, const std::string &value) |
virtual const char * | why () 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 Exception * | clone (void) const |
const char * | getFileName () const |
const char * | getFunctionName () const |
unsigned long | getLineNumber () const |
virtual bool | operator!= (const Exception exc2) |
Exception & | operator= (const Exception &m) |
virtual bool | operator== (const Exception exc2) |
virtual void | raise (void) const |
virtual const char * | what () const throw () |
Static Public Member Functions | |
static Fault::FaultCode | getFaultCodeFromName (const rwsf::XmlName &name) |
Additional Inherited Members | |
Related Functions inherited from rwsf::Exception | |
#define | RWSF_DECLARE_EXCEPTION_METHODS(className) |
#define | RWSF_DEFINE_EXCEPTION_METHODS(className) |
#define | RWSF_EINFO |
rwsf::Fault and its derived classes rwsf::ClientFault and rwsf::ServerFault represent SOAP faults. In addition, if a fault is specified in the WSDL, RWSF generates a special class for it, which also derives from rwsf::Fault. On the client, generic faults that are not defined in the WSDL are propagated out to the client and thrown as an rwsf::SoapFaultException. To see how WSDL-defined and generic faults work, run the example Fault in your installdir \examples\webservices\Fault
directory.
Enumeration containing the three possible encoding styles for the fault. For the wrapped
encoding style, RWSF "unwraps" the top level element,and treats each of the element's parts as arguments to the operation. (For more information on the wrapped style, see the Web Service Development Guide.)
Enumerator | |
---|---|
Rpc |
SOAP RPC (Remote Procedure Call) encoding. |
Document |
SOAP document-style encoding. |
Wrapped |
Wrapped encoding. |
Enumeration containing the four possible fault codes.
rwsf::Fault::Fault | ( | ) |
Default constructor.
rwsf::Fault::Fault | ( | FaultCode | faultCode, |
const std::string & | faultString | ||
) |
Constructs an instance of rwsf::Fault containing a fault code and the fault message.
|
virtual |
Virtual destructor.
std::string rwsf::Fault::asString | ( | ) | const |
Returns the SOAP fault message as a string. Allows derived classes to marshal detail elements into the SOAP fault message. Implemented by generated fault classes.
EncodingStyle rwsf::Fault::getEncodingStyle | ( | ) | const |
Returns the encoding style element.
Fault::FaultCode rwsf::Fault::getFaultCode | ( | ) | const |
Returns the FaultCode enumeration.
std::string rwsf::Fault::getFaultCodeAsString | ( | ) | const |
Returns fault code as a string.
|
static |
Returns the FaultCode for name. By default, returns the server fault code.
std::string rwsf::Fault::getFaultString | ( | ) | const |
Returns the fault message as a string.
std::string rwsf::Fault::getProperty | ( | const std::string & | key | ) | const |
Returns the property represented by key. (This method supports marshaling in the generated fault classes.)
|
virtual |
Initializes the fault
object. This method can be used to initialize fault properties with an existing rwsf::Config object.
void rwsf::Fault::setEncodingStyle | ( | EncodingStyle | style | ) |
Sets the encoding style element.
void rwsf::Fault::setFaultCode | ( | Fault::FaultCode | faultCode | ) |
Sets the fault code.
void rwsf::Fault::setFaultString | ( | const std::string & | faultString | ) |
Sets the fault string.
void rwsf::Fault::setProperty | ( | const std::string & | key, |
const std::string & | value | ||
) |
Sets the property key to value. Used to set the property RWSF:doEscape to define whether whether or not text is escaped. If the value is set to false
, the fault data is be escaped; in all other cases it is escaped.
|
virtual |
Returns fault message as a null terminated character array.
Reimplemented from rwsf::Exception.
Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved. |