00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __AXISEXCEPTION_H_OF_AXIS_INCLUDED_
00022 #define __AXISEXCEPTION_H_OF_AXIS_INCLUDED_
00023
00024 #include <string>
00025 #include <exception>
00026 #include <new>
00027 #include <typeinfo>
00028 #include <stdexcept>
00029
00030 using namespace std;
00031
00032
00033 #ifdef ENABLE_AXIS_EXCEPTION
00034 #define AXISC_TRY try {
00035 #define AXISC_CATCH(X) } catch (X) {
00036 #define AXISC_ENDCATCH }
00037
00038 #define THROW_AXIS_EXCEPTION(X) throw AxisException(X)
00039 #define THROW_AXIS_CONFIG_EXCEPTION(X) throw AxisConfigException(X)
00040 #define THROW_AXIS_SOAP_EXCEPTION(X) throw AxisSoapException(X)
00041 #define THROW_AXIS_WSDD_EXCEPTION(X) throw AxisWsddException(X)
00042 #define THROW_AXIS_ENGINE_EXCEPTION(X) throw AxisEngineException(X)
00043 #define THROW_AXIS_TRANSPORT_EXCEPTION(X) throw AxisTransportException(X)
00044 #define THROW_AXIS_PARSE_EXCEPTION(X) throw AxisParseException(X)
00045
00046 #define THROW_AXIS_BAD_ALLOC() throw std::bad_alloc
00047 #define THROW_AXIS_BAD_CAST() throw std::bad_cast
00048 #define THROW_AXIS_BAD_TYPEID() throw std::bad_typeid
00049 #define THROW_AXIS_BAD_EXCEPTION() throw std::bad_exception
00050 #define THROW_AXIS_OUT_OF_RANGE(X) throw std::out_of_range
00051 #define THROW_AXIS_INVALID_ARGUMENT(X) throw std::invalid_argument
00052 #define THROW_AXIS_OVERFLOW_ERROR(X) throw std::overflow_error
00053
00054
00055 #define AXISC_THROW_SAME throw
00056
00057 #else
00058
00059 #define AXISC_TRY
00060 #define AXISC_CATCH(X)
00061 #define AXISC_ENDCATCH
00062
00063 #define THROW_AXIS_EXCEPTION(X) return X
00064 #define THROW_AXIS_CONFIG_EXCEPTION(X) return X
00065 #define THROW_AXIS_SOAP_EXCEPTION(X) return X
00066 #define THROW_AXIS_WSDD_EXCEPTION(X) return X
00067 #define THROW_AXIS_ENGINE_EXCEPTION(X) return X
00068 #define THROW_AXIS_TRANSPORT_EXCEPTION(X) return X
00069 #define THROW_AXIS_PARSE_EXCEPTION(X) return X
00070
00071 #define THROW_AXIS_BAD_ALLOC()
00072 #define THROW_AXIS_BAD_CAST()
00073 #define THROW_AXIS_BAD_TYPEID()
00074 #define THROW_AXIS_BAD_EXCEPTION()
00075 #define THROW_AXIS_OUT_OF_RANGE(X)
00076 #define THROW_AXIS_INVALID_ARGUMENT(X)
00077 #define THROW_AXIS_OVERFLOW_ERROR(X)
00078 #define THROW_AXIS_IOS_BASE_FAILURE(X)
00079
00080 #define AXISC_THROW_SAME
00081 #endif
00082
00083
00084
00085
00086
00087 enum AXISC_EXCEPTIONS
00088 {
00089
00090 SOAP_VERSION_MISMATCH,
00091
00092
00093 SOAP_MUST_UNDERSTAND,
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 CLIENT_SOAP_MESSAGE_INCOMPLETE,
00114 CLIENT_SOAP_SOAP_ACTION_EMTPY,
00115 CLIENT_SOAP_SOAP_CONTENT_ERROR,
00116 CLIENT_SOAP_NO_SOAP_METHOD,
00117 CLIENT_SOAP_CONTENT_NOT_SOAP,
00118 CLIENT_WSDD_SERVICE_NOT_FOUND,
00119 CLIENT_WSDD_METHOD_NOT_ALLOWED,
00120 CLIENT_WSDD_PARA_TYPE_MISMATCH,
00121 CLIENT_ENGINE_CLIENT_HANDLER_FAILED,
00122
00123
00124 SERVER_ENGINE_EXCEPTION,
00125 SERVER_ENGINE_COULD_NOT_LOAD_SRV,
00126 SERVER_ENGINE_COULD_NOT_LOAD_HDL,
00127 SERVER_ENGINE_HANDLER_FAILED,
00128 SERVER_ENGINE_WEBSERVICE_FAILED,
00129 SERVER_ENGINE_HANDLER_INIT_FAILED,
00130 SERVER_ENGINE_HANDLER_CREATION_FAILED,
00131 SERVER_ENGINE_LIBRARY_LOADING_FAILED,
00132 SERVER_ENGINE_HANDLER_NOT_LOADED,
00133 SERVER_ENGINE_HANDLER_BEING_USED,
00134 SERVER_ENGINE_GET_HANDLER_FAILED,
00135 SERVER_ENGINE_WRONG_HANDLER_TYPE,
00136 SERVER_CONFIG_EXCEPTION,
00137 SERVER_CONFIG_TRANSPORT_CONF_FAILED,
00138 SERVER_CONFIG_LIBRARY_PATH_EMPTY,
00139 SERVER_WSDD_EXCEPTION,
00140 SERVER_WSDD_NO_HANDLERS_CONFIGURED,
00141 SERVER_SOAP_EXCEPTION,
00142 SERVER_TRANSPORT_EXCEPTION,
00143 SERVER_TRANSPORT_RECEPTION_EXCEPTION,
00144 SERVER_TRANSPORT_SENDING_EXCEPTION,
00145 SERVER_TRANSPORT_PROCESS_EXCEPTION,
00146 SERVER_TRANSPORT_UNKNOWN_HTTP_RESPONSE,
00147 SERVER_TRANSPORT_HTTP_EXCEPTION,
00148 SERVER_TRANSPORT_UNEXPECTED_STRING,
00149 SERVER_TRANSPORT_CHANNEL_INIT_ERROR,
00150 SERVER_TRANSPORT_SOCKET_CREATE_ERROR,
00151 SERVER_TRANSPORT_SOCKET_CONNECT_ERROR,
00152 SERVER_TRANSPORT_INVALID_SOCKET,
00153 SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR,
00154 SERVER_TRANSPORT_INPUT_STREAMING_ERROR,
00155 SERVER_TRANSPORT_TIMEOUT_EXCEPTION,
00156 SERVER_TRANSPORT_TIMEOUT_EXPIRED,
00157 SERVER_TRANSPORT_BUFFER_EMPTY,
00158 SERVER_PARSE_BUFFER_EMPTY,
00159 SERVER_PARSE_PARSER_FAILED,
00160
00161 SERVER_TEST_EXCEPTION,
00162 SERVER_UNKNOWN_ERROR,
00163
00164
00165 AXISC_SERVICE_THROWN_EXCEPTION,
00166 AXISC_UNKNOWN_ELEMENT_EXCEPTION,
00167 AXISC_NODE_VALUE_MISMATCH_EXCEPTION,
00168 AXISC_READ_CONF_EXCEPTION,
00169
00170
00171
00172
00173
00174
00175 FAULT_LAST
00176 };
00177
00189 class AxisException :public exception
00190 {
00191
00192 public:
00194 AxisException(){};
00195
00205 AxisException(int iExceptionCode);
00206
00215 AxisException(exception* e);
00216
00223 AxisException(exception* e, int iExceptionCode);
00224
00229 AxisException(char* pcMessage){m_sMessage = pcMessage;};
00230
00232 virtual ~AxisException() throw();
00233
00237 virtual const char* what() throw();
00238
00248 virtual const int getExceptionCode();
00249 virtual const string getMessage(exception* e);
00250 virtual const string getMessage(int iExceptionCode);
00251
00252 private:
00253 void processException(exception* e);
00254 void processException(exception* e, int iExceptionCode);
00255 void processException(int iExceptionCode);
00256 string m_sMessage;
00257 int m_iExceptionCode;
00258 };
00259
00260 #endif
00261