HydraExpress 4.6 |
HydraExpress C++ API Reference Guide |
|
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 () |
virtual const char * | why () const |
std::string | asString () const |
Fault::FaultCode | getFaultCode () const |
std::string | getFaultCodeAsString () const |
std::string | getFaultString () const |
void | setFaultCode (Fault::FaultCode faultCode) |
void | setFaultString (const std::string &faultString) |
void | setEncodingStyle (EncodingStyle style) |
EncodingStyle | getEncodingStyle () const |
void | setProperty (const std::string &key, const std::string &value) |
std::string | getProperty (const std::string &key) const |
virtual void | init (const rwsf::Config &initParams) |
Static Public Member Functions | |
static Fault::FaultCode | getFaultCodeFromName (const rwsf::XmlName &name) |
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.)
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 rwsf::Fault::~Fault | ( | ) | throw () [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 Fault::FaultCode rwsf::Fault::getFaultCodeFromName | ( | const rwsf::XmlName & | name | ) | [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 void rwsf::Fault::init | ( | const rwsf::Config & | initParams | ) | [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 const char* rwsf::Fault::why | ( | ) | const [virtual] |
Returns fault message as a null terminated character array.
Reimplemented from rwsf::Exception.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.