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_EXCEPTION2(X, Y) throw AxisGenException(X, Y)
00055 #define THROW_AXIS_CONFIG_EXCEPTION2(X, Y) throw AxisConfigException(X, Y)
00056 #define THROW_AXIS_SOAP_EXCEPTION2(X, Y) throw AxisSoapException(X, Y)
00057 #define THROW_AXIS_WSDD_EXCEPTION2(X, Y) throw AxisWsddException(X, Y)
00058 #define THROW_AXIS_ENGINE_EXCEPTION2(X, Y) throw AxisEngineException(X, Y)
00059 #define THROW_AXIS_TRANSPORT_EXCEPTION2(X, Y) throw AxisTransportException(X, Y)
00060 #define THROW_AXIS_PARSE_EXCEPTION2(X, Y) throw AxisParseException(X, Y)
00061 
00062 #define THROW_AXIS_BAD_ALLOC() throw std::bad_alloc
00063 #define THROW_AXIS_BAD_CAST() throw std::bad_cast
00064 #define THROW_AXIS_BAD_TYPEID() throw std::bad_typeid
00065 #define THROW_AXIS_BAD_EXCEPTION() throw std::bad_exception
00066 #define THROW_AXIS_OUT_OF_RANGE(X) throw std::out_of_range
00067 #define THROW_AXIS_INVALID_ARGUMENT(X) throw std::invalid_argument
00068 #define THROW_AXIS_OVERFLOW_ERROR(X) throw std::overflow_error
00069 //#define THROW_AXIS_IOS_BASE_FAILURE(X) throw std::ios_base::failure
00070 
00071 #define AXISC_THROW_SAME throw
00072 
00073 #else
00074 
00075 #define AXISC_TRY 
00076 #define AXISC_CATCH(X) 
00077 #define AXISC_ENDCATCH
00078 
00079 #define THROW_AXIS_EXCEPTION(X) return X
00080 #define THROW_AXIS_CONFIG_EXCEPTION(X) return X
00081 #define THROW_AXIS_SOAP_EXCEPTION(X) return X
00082 #define THROW_AXIS_WSDD_EXCEPTION(X) return X
00083 #define THROW_AXIS_ENGINE_EXCEPTION(X) return X
00084 #define THROW_AXIS_TRANSPORT_EXCEPTION(X) return X
00085 #define THROW_AXIS_PARSE_EXCEPTION(X) return X
00086 
00087 #define THROW_AXIS_EXCEPTION2(X, Y) return X
00088 #define THROW_AXIS_CONFIG_EXCEPTION2(X, Y) return X
00089 #define THROW_AXIS_SOAP_EXCEPTION2(X, Y) return X
00090 #define THROW_AXIS_WSDD_EXCEPTION2(X, Y) return X
00091 #define THROW_AXIS_ENGINE_EXCEPTION2(X, Y) return X
00092 #define THROW_AXIS_TRANSPORT_EXCEPTION2(X, Y) return X
00093 #define THROW_AXIS_PARSE_EXCEPTION2(X, Y) return X
00094 
00095 #define THROW_AXIS_BAD_ALLOC()
00096 #define THROW_AXIS_BAD_CAST()
00097 #define THROW_AXIS_BAD_TYPEID()
00098 #define THROW_AXIS_BAD_EXCEPTION()
00099 #define THROW_AXIS_OUT_OF_RANGE(X)
00100 #define THROW_AXIS_INVALID_ARGUMENT(X)
00101 #define THROW_AXIS_OVERFLOW_ERROR(X)
00102 #define THROW_AXIS_IOS_BASE_FAILURE(X)
00103 
00104 #define AXISC_THROW_SAME 
00105 #endif
00106 
00107 /*
00108  * The following enumeration is used to serve the Axis C++ codes for 
00109  * faults.
00110  */
00111 enum AXISC_EXCEPTIONS 
00112 {
00113     /* VersionMismatch faults */
00114     SOAP_VERSION_MISMATCH,
00115     
00116     /* MustUnderstand faults */
00117     SOAP_MUST_UNDERSTAND,
00118 
00119     /*The notation used for naming these exceptions is as follows
00120      *CLIENT at the beginning means when this interpreted as a soap fault
00121      *    it's fault code is CLIENT
00122      *SERVER at the beginning means when this interpreted as a soap fault
00123      *    it's fault code is SERVER
00124      *SOAP that comes next to CLIENT/SERVER means this is a soap releated
00125      *    exception
00126      *ENGINE that comes next to CLIENT/SERVER means this is a axisc++ engine
00127      *    related exception
00128      *WSDD that comes next to CLIENT/SERVER means this is a wsdd releated
00129      *    exception
00130      *TRANSPORT that comes next to CLIENT/SERVER means this is a transport releated
00131      *    exception
00132      *CONFIG that comes next to CLIENT/SERVER means this is a axisc++ configuration
00133      *    related exception
00134      */
00135      
00136     /* Client faults */
00137     CLIENT_SOAP_MESSAGE_INCOMPLETE,
00138     CLIENT_SOAP_SOAP_ACTION_EMTPY,
00139     CLIENT_SOAP_SOAP_CONTENT_ERROR,
00140     CLIENT_SOAP_NO_SOAP_METHOD,
00141     CLIENT_SOAP_CONTENT_NOT_SOAP,
00142     CLIENT_WSDD_SERVICE_NOT_FOUND,
00143     CLIENT_WSDD_METHOD_NOT_ALLOWED,
00144     CLIENT_WSDD_PARA_TYPE_MISMATCH,
00145     CLIENT_ENGINE_CLIENT_HANDLER_FAILED,
00146 
00147     /* Server faults */
00148     SERVER_ENGINE_EXCEPTION,
00149     SERVER_ENGINE_COULD_NOT_LOAD_SRV,
00150     SERVER_ENGINE_COULD_NOT_LOAD_HDL,
00151     SERVER_ENGINE_LOADING_TRANSPORT_FAILED,
00152     SERVER_ENGINE_LOADING_PARSER_FAILED,
00153     SERVER_ENGINE_HANDLER_FAILED,
00154     SERVER_ENGINE_WEBSERVICE_FAILED,
00155     SERVER_ENGINE_HANDLER_INIT_FAILED,
00156     SERVER_ENGINE_HANDLER_CREATION_FAILED,
00157     SERVER_ENGINE_LIBRARY_LOADING_FAILED,
00158     SERVER_ENGINE_HANDLER_NOT_LOADED,
00159     SERVER_ENGINE_HANDLER_BEING_USED,
00160     SERVER_ENGINE_GET_HANDLER_FAILED,
00161     SERVER_ENGINE_WRONG_HANDLER_TYPE,
00162     SERVER_CONFIG_EXCEPTION,
00163     SERVER_CONFIG_TRANSPORT_CONF_FAILED,
00164     SERVER_CONFIG_LIBRARY_PATH_EMPTY,
00165     SERVER_WSDD_EXCEPTION,
00166     SERVER_WSDD_NO_HANDLERS_CONFIGURED,
00167     SERVER_SOAP_EXCEPTION,
00168     SERVER_TRANSPORT_EXCEPTION,
00169     SERVER_TRANSPORT_RECEPTION_EXCEPTION,
00170     SERVER_TRANSPORT_SENDING_EXCEPTION,
00171     SERVER_TRANSPORT_PROCESS_EXCEPTION,
00172     SERVER_TRANSPORT_UNKNOWN_HTTP_RESPONSE,
00173     SERVER_TRANSPORT_HTTP_EXCEPTION,
00174     SERVER_TRANSPORT_UNEXPECTED_STRING,
00175     SERVER_TRANSPORT_CHANNEL_INIT_ERROR,
00176     SERVER_TRANSPORT_SOCKET_CREATE_ERROR,
00177     SERVER_TRANSPORT_SOCKET_CONNECT_ERROR,
00178     SERVER_TRANSPORT_INVALID_SOCKET,
00179     SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR,
00180     SERVER_TRANSPORT_INPUT_STREAMING_ERROR,
00181     SERVER_TRANSPORT_TIMEOUT_EXCEPTION,
00182     SERVER_TRANSPORT_TIMEOUT_EXPIRED,
00183     SERVER_TRANSPORT_BUFFER_EMPTY,
00184     SERVER_PARSE_BUFFER_EMPTY,
00185     SERVER_PARSE_PARSER_FAILED, 
00186     SERVER_PARSE_TRANSPORT_FAILED,
00187  
00188     SERVER_TEST_EXCEPTION,
00189     SERVER_UNKNOWN_ERROR,
00190     /*Following exceptions are not releated to soap faults
00191      */
00192     AXISC_SERVICE_THROWN_EXCEPTION,
00193     AXISC_UNKNOWN_ELEMENT_EXCEPTION,
00194     AXISC_NODE_VALUE_MISMATCH_EXCEPTION,
00195     AXISC_READ_CONF_EXCEPTION,
00196 
00197     /*
00198      * This FAULT_LAST is not used as a fault code, but instead is used 
00199      * internaly in the code. Developers should not use this as a fault 
00200      * code.
00201      */
00202     FAULT_LAST 
00203 };
00204 
00216 class STORAGE_CLASS_INFO AxisException :public exception
00217 {
00218 
00219 public:
00221     //AxisException(){};
00222 
00232     //AxisException(const int iExceptionCode);
00233 
00245     //AxisException(const int iExceptionCode, char* pcMessage);
00246 
00255     //AxisException(const exception* e);
00256 
00263     //AxisException(const exception* e, const int iExceptionCode);
00264     
00269     //AxisException(const char* pcMessage){m_sMessage = pcMessage;};
00270     
00272     virtual ~AxisException() throw(){};
00273 
00277     virtual const char* what() throw() = 0;
00278 
00288     virtual const int getExceptionCode() = 0;
00289 /*    virtual const AxisString getMessage(const exception* e);
00290     virtual const AxisString getMessage(const int iExceptionCode);    
00291 
00292 private:
00293     void processException(const exception* e);
00294     void processException(const exception* e, const int iExceptionCode);
00295     void processException(const int iExceptionCode);
00296     void processException(const int iExceptionCode, char* pcMessage);
00297     string m_sMessage; //Holds the exception messae
00298     int m_iExceptionCode; //Holds the exception code
00299 */
00300 };
00301 
00302 #endif
00303 

Generated on Tue Jun 29 09:27:55 2004 for AxisC++ by doxygen1.2.18