Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

AxisException.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  *
00016  *
00017  *
00018  */
00019 
00027 #ifndef __AXISEXCEPTION_H_OF_AXIS_INCLUDED_
00028 #define __AXISEXCEPTION_H_OF_AXIS_INCLUDED_
00029 
00030 #include <axis/server/GDefine.h>
00031 
00032 #include <string>
00033 #include <exception>
00034 #include <new>
00035 #include <typeinfo>
00036 #include <stdexcept>
00037 //#include <ios>
00038 using namespace std;
00039 
00040 
00041 #ifdef ENABLE_AXIS_EXCEPTION
00042 #define AXISC_TRY try {
00043 #define AXISC_CATCH(X) } catch (X) { 
00044 #define AXISC_ENDCATCH }
00045 
00046 #define THROW_AXIS_EXCEPTION(X) throw AxisGenException(X)
00047 #define THROW_AXIS_CONFIG_EXCEPTION(X) throw AxisConfigException(X)
00048 #define THROW_AXIS_SOAP_EXCEPTION(X) throw AxisSoapException(X)
00049 #define THROW_AXIS_WSDD_EXCEPTION(X) throw AxisWsddException(X)
00050 #define THROW_AXIS_ENGINE_EXCEPTION(X) throw AxisEngineException(X)
00051 #define THROW_AXIS_TRANSPORT_EXCEPTION(X) throw AxisTransportException(X)
00052 #define THROW_AXIS_PARSE_EXCEPTION(X) throw AxisParseException(X)
00053 
00054 #define THROW_AXIS_EXCEPTION_NULL(X) throw AxisGenException(X)
00055 #define THROW_AXIS_CONFIG_EXCEPTION_NULL(X) throw AxisConfigException(X)
00056 #define THROW_AXIS_SOAP_EXCEPTION_NULL(X) throw AxisSoapException(X)
00057 #define THROW_AXIS_WSDD_EXCEPTION_NULL(X) throw AxisWsddException(X)
00058 #define THROW_AXIS_ENGINE_EXCEPTION_NULL(X) throw AxisEngineException(X)
00059 #define THROW_AXIS_TRANSPORT_EXCEPTION_NULL(X) throw AxisTransportException(X)
00060 #define THROW_AXIS_PARSE_EXCEPTION_NULL(X) throw AxisParseException(X)
00061 
00062 #define THROW_AXIS_EXCEPTION2(X, Y) throw AxisGenException(X, Y)
00063 #define THROW_AXIS_CONFIG_EXCEPTION2(X, Y) throw AxisConfigException(X, Y)
00064 #define THROW_AXIS_SOAP_EXCEPTION2(X, Y) throw AxisSoapException(X, Y)
00065 #define THROW_AXIS_WSDD_EXCEPTION2(X, Y) throw AxisWsddException(X, Y)
00066 #define THROW_AXIS_ENGINE_EXCEPTION2(X, Y) throw AxisEngineException(X, Y)
00067 #define THROW_AXIS_TRANSPORT_EXCEPTION2(X, Y) throw AxisTransportException(X, Y)
00068 #define THROW_AXIS_PARSE_EXCEPTION2(X, Y) throw AxisParseException(X, Y)
00069 
00070 #define THROW_AXIS_BAD_ALLOC() throw std::bad_alloc
00071 #define THROW_AXIS_BAD_CAST() throw std::bad_cast
00072 #define THROW_AXIS_BAD_TYPEID() throw std::bad_typeid
00073 #define THROW_AXIS_BAD_EXCEPTION() throw std::bad_exception
00074 #define THROW_AXIS_OUT_OF_RANGE(X) throw std::out_of_range
00075 #define THROW_AXIS_INVALID_ARGUMENT(X) throw std::invalid_argument
00076 #define THROW_AXIS_OVERFLOW_ERROR(X) throw std::overflow_error
00077 //#define THROW_AXIS_IOS_BASE_FAILURE(X) throw std::ios_base::failure
00078 
00079 #define AXISC_THROW_SAME throw
00080 
00081 #else
00082 
00083 #define AXISC_TRY 
00084 #define AXISC_CATCH(X) 
00085 #define AXISC_ENDCATCH
00086 
00087 #define THROW_AXIS_EXCEPTION(X) return X
00088 #define THROW_AXIS_CONFIG_EXCEPTION(X) return X
00089 #define THROW_AXIS_SOAP_EXCEPTION(X) return X
00090 #define THROW_AXIS_WSDD_EXCEPTION(X) return X
00091 #define THROW_AXIS_ENGINE_EXCEPTION(X) return X
00092 #define THROW_AXIS_TRANSPORT_EXCEPTION(X) return X
00093 #define THROW_AXIS_PARSE_EXCEPTION(X) return X
00094 
00095 #define THROW_AXIS_EXCEPTION_NULL(X) return NULL
00096 #define THROW_AXIS_CONFIG_EXCEPTION_NULL(X) return NULL
00097 #define THROW_AXIS_SOAP_EXCEPTION_NULL(X) return NULL
00098 #define THROW_AXIS_WSDD_EXCEPTION_NULL(X) return NULL
00099 #define THROW_AXIS_ENGINE_EXCEPTION_NULL(X) return NULL
00100 #define THROW_AXIS_TRANSPORT_EXCEPTION_NULL(X) return NULL
00101 #define THROW_AXIS_PARSE_EXCEPTION_NULL(X) return NULL
00102 
00103 #define THROW_AXIS_EXCEPTION2(X, Y) return X
00104 #define THROW_AXIS_CONFIG_EXCEPTION2(X, Y) return X
00105 #define THROW_AXIS_SOAP_EXCEPTION2(X, Y) return X
00106 #define THROW_AXIS_WSDD_EXCEPTION2(X, Y) return X
00107 #define THROW_AXIS_ENGINE_EXCEPTION2(X, Y) return X
00108 #define THROW_AXIS_TRANSPORT_EXCEPTION2(X, Y) return X
00109 #define THROW_AXIS_PARSE_EXCEPTION2(X, Y) return X
00110 
00111 #define THROW_AXIS_BAD_ALLOC()
00112 #define THROW_AXIS_BAD_CAST()
00113 #define THROW_AXIS_BAD_TYPEID()
00114 #define THROW_AXIS_BAD_EXCEPTION()
00115 #define THROW_AXIS_OUT_OF_RANGE(X)
00116 #define THROW_AXIS_INVALID_ARGUMENT(X)
00117 #define THROW_AXIS_OVERFLOW_ERROR(X)
00118 #define THROW_AXIS_IOS_BASE_FAILURE(X)
00119 
00120 #define AXISC_THROW_SAME 
00121 #endif
00122 
00123 /*
00124  * The following enumeration is used to serve the Axis C++ codes for 
00125  * faults.
00126  */
00127 enum AXISC_EXCEPTIONS 
00128 {
00129     /* VersionMismatch faults */
00130     SOAP_VERSION_MISMATCH,
00131     
00132     /* MustUnderstand faults */
00133     SOAP_MUST_UNDERSTAND,
00134 
00135     /*The notation used for naming these exceptions is as follows
00136      *CLIENT at the beginning means when this interpreted as a soap fault
00137      *    it's fault code is CLIENT
00138      *SERVER at the beginning means when this interpreted as a soap fault
00139      *    it's fault code is SERVER
00140      *SOAP that comes next to CLIENT/SERVER means this is a soap releated
00141      *    exception
00142      *ENGINE that comes next to CLIENT/SERVER means this is a axisc++ engine
00143      *    related exception
00144      *WSDD that comes next to CLIENT/SERVER means this is a wsdd releated
00145      *    exception
00146      *TRANSPORT that comes next to CLIENT/SERVER means this is a transport releated
00147      *    exception
00148      *CONFIG that comes next to CLIENT/SERVER means this is a axisc++ configuration
00149      *    related exception
00150      */
00151      
00152     /* Client faults */
00153     CLIENT_SOAP_MESSAGE_INCOMPLETE,
00154     CLIENT_SOAP_SOAP_ACTION_EMTPY,
00155     CLIENT_SOAP_SOAP_CONTENT_ERROR,
00156     CLIENT_SOAP_NO_SOAP_METHOD,
00157     CLIENT_SOAP_CONTENT_NOT_SOAP,
00158     CLIENT_WSDD_SERVICE_NOT_FOUND,
00159     CLIENT_WSDD_METHOD_NOT_ALLOWED,
00160     CLIENT_WSDD_PARA_TYPE_MISMATCH,
00161     CLIENT_ENGINE_CLIENT_HANDLER_FAILED,
00162 
00163     /* Server faults */
00164     SERVER_ENGINE_EXCEPTION,
00165     SERVER_ENGINE_COULD_NOT_LOAD_SRV,
00166     SERVER_ENGINE_COULD_NOT_LOAD_HDL,
00167     SERVER_ENGINE_LOADING_TRANSPORT_FAILED,
00168     SERVER_ENGINE_LOADING_PARSER_FAILED,
00169     SERVER_ENGINE_HANDLER_FAILED,
00170     SERVER_ENGINE_WEBSERVICE_FAILED,
00171     SERVER_ENGINE_HANDLER_INIT_FAILED,
00172     SERVER_ENGINE_HANDLER_CREATION_FAILED,
00173     SERVER_ENGINE_LIBRARY_LOADING_FAILED,
00174     SERVER_ENGINE_HANDLER_NOT_LOADED,
00175     SERVER_ENGINE_HANDLER_BEING_USED,
00176     SERVER_ENGINE_GET_HANDLER_FAILED,
00177     SERVER_ENGINE_WRONG_HANDLER_TYPE,
00178     SERVER_CONFIG_EXCEPTION,
00179     SERVER_CONFIG_TRANSPORT_CONF_FAILED,
00180     SERVER_CONFIG_LIBRARY_PATH_EMPTY,
00181     SERVER_WSDD_EXCEPTION,
00182     SERVER_WSDD_NO_HANDLERS_CONFIGURED,
00183     SERVER_SOAP_EXCEPTION,
00184     SERVER_TRANSPORT_EXCEPTION,
00185     SERVER_TRANSPORT_RECEPTION_EXCEPTION,
00186     SERVER_TRANSPORT_SENDING_EXCEPTION,
00187     SERVER_TRANSPORT_PROCESS_EXCEPTION,
00188     SERVER_TRANSPORT_UNKNOWN_HTTP_RESPONSE,
00189     SERVER_TRANSPORT_HTTP_EXCEPTION,
00190     SERVER_TRANSPORT_UNEXPECTED_STRING,
00191     SERVER_TRANSPORT_CHANNEL_INIT_ERROR,
00192     SERVER_TRANSPORT_SOCKET_CREATE_ERROR,
00193     SERVER_TRANSPORT_SOCKET_CONNECT_ERROR,
00194     SERVER_TRANSPORT_INVALID_SOCKET,
00195     SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR,
00196     SERVER_TRANSPORT_INPUT_STREAMING_ERROR,
00197     SERVER_TRANSPORT_TIMEOUT_EXCEPTION,
00198     SERVER_TRANSPORT_TIMEOUT_EXPIRED,
00199     SERVER_TRANSPORT_BUFFER_EMPTY,
00200     SERVER_PARSE_BUFFER_EMPTY,
00201     SERVER_PARSE_PARSER_FAILED, 
00202     SERVER_PARSE_TRANSPORT_FAILED,
00203  
00204     SERVER_TEST_EXCEPTION,
00205     SERVER_UNKNOWN_ERROR,
00206     /*Following exceptions are not releated to soap faults
00207      */
00208     AXISC_SERVICE_THROWN_EXCEPTION,
00209     AXISC_UNKNOWN_ELEMENT_EXCEPTION,
00210     AXISC_NODE_VALUE_MISMATCH_EXCEPTION,
00211     AXISC_READ_CONF_EXCEPTION,
00212 
00213     /*
00214      * This FAULT_LAST is not used as a fault code, but instead is used 
00215      * internaly in the code. Developers should not use this as a fault 
00216      * code.
00217      */
00218     FAULT_LAST 
00219 };
00220 
00232 class STORAGE_CLASS_INFO AxisException :public exception
00233 {
00234 
00235 public:
00237     //AxisException(){};
00238 
00248     //AxisException(const int iExceptionCode);
00249 
00261     //AxisException(const int iExceptionCode, char* pcMessage);
00262 
00271     //AxisException(const exception* e);
00272 
00279     //AxisException(const exception* e, const int iExceptionCode);
00280     
00285     //AxisException(const char* pcMessage){m_sMessage = pcMessage;};
00286     
00288     virtual ~AxisException() throw(){};
00289 
00293     virtual const char* what() throw() = 0;
00294 
00304     virtual const int getExceptionCode() = 0;
00305 /*    virtual const AxisString getMessage(const exception* e);
00306     virtual const AxisString getMessage(const int iExceptionCode);    
00307 
00308 private:
00309     void processException(const exception* e);
00310     void processException(const exception* e, const int iExceptionCode);
00311     void processException(const int iExceptionCode);
00312     void processException(const int iExceptionCode, char* pcMessage);
00313     string m_sMessage; //Holds the exception messae
00314     int m_iExceptionCode; //Holds the exception code
00315 */
00316 };
00317 
00318 #endif
00319 

Generated on Fri Jul 9 13:18:28 2004 for AxisC++ by doxygen1.2.18