HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Types | Public Member Functions | Static Public Member Functions
rwsf::Fault Class Reference

Represents SOAP faults through its derived classes ClientFault and ServerFault. More...

#include <rwsf/webservice/Fault.h>

Inheritance diagram for rwsf::Fault:
rwsf::Exception rwsf::ClientFault rwsf::ServerFault

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 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 ()
 

Static Public Member Functions

static Fault::FaultCode getFaultCodeFromName (const rwsf::XmlName &name)
 

Additional Inherited Members

Detailed Description

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.

Member Enumeration Documentation

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.

Enumerator
VersionMismatch 

Invalid namespace for the SOAP Envelope element.

MustUnderstand 

A SOAP Header child element with mustUnderstand set to "true" was either not understood or not obeyed when processed.

Client 

The client request was incorrectly formed or contained incomplete information. This generally means that the message requires fixing before resending.

Server 

The message could not be processed for reasons unrelated to the contents of the message, but rather the processing of the message. The message may succeed at a later point in time.

Constructor & Destructor Documentation

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.

Member Function Documentation

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 © 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.