rwsf::Fault rwsf::Exception
#include <rw/rwsf/soapworx/Fault.h>
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 a rwsf::SoapFaultException. To see how WSDL-defined and generic faults work, run the example Fault in your installdir\examples\webservices\Fault directory.
Fault();
Default constructor.
Fault(const FaultCode& faultCode, const std::string& faultString);
Constructs an instance of rwsf::Fault containing a fault code and the error message.
Parameters:
faultCode |
Corresponds to the code element required in SOAP fault messages |
faultString |
Corresponds to the human-readable string element required in SOAP fault messages |
virtual ~Fault();
Virtual destructor.
enum EncodingStyle { Rpc = 1, Document = 2 Wrapped = 3 };
Enumeration containing the three possible encoding styles for the fault. If Rpc = 1, the fault's encoding style is SOAP's RPC (Remote Procedure Call); if Document = 2, the encoding style is the SOAP document-style encoding; if Wrapped = 3,the encoding style is "wrapped," meaning that rwsf will "unwrap" the top level element, and treat each of the element's parts as arguments to the operation. (For more information on the wrapped style, see Section 8.3.8, "Wrapped Style Operations," in the HydraExpress Web Service Development Guide
enum FaultCode { VersionMismatch = 1, MustUnderstand = 2, Client = 3, Server = 4 };
Enumeration containing the four possible fault codes.
static rwsf::XmlNamespace soapEnvNS;
Static rwsf::XmlNamespace object containing the namespace identified in the SOAP envelope.
static rwsf::XmlName VersionMismatchName; static rwsf::XmlName MustUnderstandName; static rwsf::XmlName ClientName; static rwsf::XmlName ServerName;
Static rwsf::XmlName objects representing the four basic fault codes.
std::string 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 getEncodingStyle() const;
Returns the EncodingStyle element.
Fault::FaultCode getFaultCode() const;
Returns the enumeration, faultCode.
std::string getFaultCodeAsString() const;
Returns fault string as a string.
std::string getProperty(const std::string& key) const;
Returns the property represented by key. (This method supports marshaling in the generated fault classes.) Used to set the property rwsf:doEScape to define whether or not text will be escaped.
virtual void init(const rwsf::Config& initParams);
Initializes the fault object. This method can be used to initialize fault properties with an existing rwsf::Config object.
void setFaultCode(Fault::FaultCode faultCode);
Sets the fault code.
void setFaultString(const std::string& faultString);
Sets the fault string.
void setEncodingStyle(Fault::EncodingStyle style);
Sets the encoding style element.
void setProperty(const std::string& key, const std::string& value);
Sets the property key to value. (This method supports marshaling in the generated fault classes.) Used to set the property rwsf:doEScape to define whether or not text will be escaped.
Fault::EncodingStyle getEncodingStyle() const;
Returns the encoding style element.
static Fault::FaultCode getFaultCodeFromName(const rwsf::XmlName& name);
Returns the fault code from the name.
virtual const char * why() const;
Returns faultString_.data().
rwsf::ClientFault and rwsf::ServerFault.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.