You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2004/05/18 06:32:32 UTC
cvs commit: ws-axis/c/src/wsdd AxisWsddException.cpp Makefile.am
damitha 2004/05/17 21:32:32
Modified: c configure.ac
c/deploy deploy.sh_apache
c/include/axis/server AxisException.h
IWrapperSoapSerializer.h SoapDeSerializer.h
SoapSerializer.h
c/samples/server/rpcfault MathOps.cpp MathOps.h MathOps.wsdl
MathOpsWrapper.cpp MathOpsWrapper.h
c/src/common AxisConfigException.cpp AxisException.cpp
Makefile.am
c/src/engine AppScopeHandlerPool.cpp Axis.cpp
AxisEngineException.cpp HandlerLoader.cpp
HandlerLoader.h HandlerPool.cpp
c/src/engine/client ClientAxisEngine.cpp Makefile.am
c/src/engine/server Makefile.am ServerAxisEngine.cpp
ServerAxisEngine.h
c/src/soap AxisSoapException.cpp Makefile.am
Makefile.am_expat Makefile.am_xercesc SoapBody.cpp
SoapBody.h SoapDeSerializer.cpp SoapFault.cpp
SoapSerializer.cpp
c/src/transport/axis HttpTransport.cpp Makefile.am
Receiver.cpp Sender.cpp
c/src/wsdd AxisWsddException.cpp Makefile.am
Added: c/src/soap SoapFault.h
Removed: c/include/axis/server SoapFault.h SoapFaults.h
Log:
Revision Changes Path
1.17 +2 -2 ws-axis/c/configure.ac
Index: configure.ac
===================================================================
RCS file: /home/cvs/ws-axis/c/configure.ac,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- configure.ac 14 May 2004 08:30:18 -0000 1.16
+++ configure.ac 18 May 2004 04:32:29 -0000 1.17
@@ -2,8 +2,8 @@
AM_INIT_AUTOMAKE(0.3)
AM_CONFIG_HEADER(config.h)
#if you use expat parser
-CFLAGS="-Wall -Wshadow -DUSE_EXPAT_PARSER"
-CPPFLAGS="-Wall -Wshadow -DUSE_EXPAT_PARSER"
+CFLAGS="-Wall -Wshadow -DUSE_EXPAT_PARSER -DENABLE_AXIS_EXCEPTION"
+CPPFLAGS="-Wall -Wshadow -DUSE_EXPAT_PARSER -DENABLE_AXIS_EXCEPTION"
LDFLAGS="-s -L$EXPAT_HOME/lib -lexpat -lstdc++"
#if you use xercesc parser
#CFLAGS="-Wall -Wshadow -DUSE_XERCES_PARSER"
1.3 +4 -0 ws-axis/c/deploy/deploy.sh_apache
Index: deploy.sh_apache
===================================================================
RCS file: /home/cvs/ws-axis/c/deploy/deploy.sh_apache,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- deploy.sh_apache 28 Apr 2004 11:41:54 -0000 1.2
+++ deploy.sh_apache 18 May 2004 04:32:30 -0000 1.3
@@ -1,9 +1,13 @@
rm /usr/local/apache/libexec/libaxiscpp_mod.so
rm webservices/libAdminService.so
rm libs/libserver_engine.so
+rm libs/libaxis_transport.so
+rm logs/AxisLog
+rm logs/AxisClientLog
cp -f $AXISCPP_HOME/bin/libAdminService.so webservices/
cp -f $AXISCPP_HOME/bin/libserver_engine.so libs/
cp -f $AXISCPP_HOME/bin/libaxiscpp_mod.so /usr/local/apache/libexec/
+cp -f $AXISCPP_HOME/bin/libaxis_transport.so libs/
/usr/local/apache/bin/apachectl stop
sleep 2
/usr/local/apache/bin/apachectl start
1.7 +64 -49 ws-axis/c/include/axis/server/AxisException.h
Index: AxisException.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisException.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AxisException.h 14 May 2004 12:19:27 -0000 1.6
+++ AxisException.h 18 May 2004 04:32:30 -0000 1.7
@@ -30,20 +30,18 @@
using namespace std;
-#ifdef __ENABLE_AXIS_EXCEPTION__
+#ifdef ENABLE_AXIS_EXCEPTION
#define AXISC_TRY try {
#define AXISC_CATCH(X) } catch (X) {
#define AXISC_ENDCATCH }
-#define AXISC_THROW(X) throw AxisException(X)
-#define THROW_AXIS_EXCEPTION() throw AxisException()
#define THROW_AXIS_EXCEPTION(X) throw AxisException(X)
-#define THROW_AXIS_CONFIG_EXCEPTION() throw AxisConfigException()
#define THROW_AXIS_CONFIG_EXCEPTION(X) throw AxisConfigException(X)
-#define THROW_AXIS_SOAP_EXCEPTION() throw AxisSoapException()
#define THROW_AXIS_SOAP_EXCEPTION(X) throw AxisSoapException(X)
-#define THROW_AXIS_WSDD_EXCEPTION() throw AxisWsddException()
#define THROW_AXIS_WSDD_EXCEPTION(X) throw AxisWsddException(X)
+#define THROW_AXIS_ENGINE_EXCEPTION(X) throw AxisEngineException(X)
+#define THROW_AXIS_TRANSPORT_EXCEPTION(X) throw AxisTransportException(X)
+
#define THROW_AXIS_BAD_ALLOC() throw std::bad_alloc
#define THROW_AXIS_BAD_CAST() throw std::bad_cast
#define THROW_AXIS_BAD_TYPEID() throw std::bad_typeid
@@ -53,7 +51,6 @@
#define THROW_AXIS_OVERFLOW_ERROR(X) throw std::overflow_error
#define THROW_AXIS_IOS_BASE_FAILURE(X) throw std::ios_base::failure
-
#define AXISC_THROW_SAME throw;
#else
#define AXISC_TRY
@@ -65,70 +62,88 @@
/*
* The following enumeration is used to serve the Axis C++ codes for
- * soap faults.
+ * faults.
*/
enum AXISC_EXCEPTIONS
{
/* VersionMismatch faults */
- SF_VERSION_MISMATCH,
+ SOAP_VERSIONMISMATCH,
/* MustUnderstand faults */
- SF_MUST_UNDERSTAND,
+ SOAP_MUSTUNDERSTAND,
+ /*The notation used for naming these exceptions is as follows
+ *CLIENT at the beginning means when this interpreted as a soap fault
+ * it's fault code is CLIENT
+ *SERVER at the beginning means when this interpreted as a soap fault
+ * it's fault code is SERVER
+ *SOAP that comes next to CLIENT/SERVER means this is a soap releated
+ * exception
+ *ENGINE that comes next to CLIENT/SERVER means this is a axisc++ engine
+ * related exception
+ *WSDD that comes next to CLIENT/SERVER means this is a wsdd releated
+ * exception
+ *TRANSPORT that comes next to CLIENT/SERVER means this is a transport releated
+ * exception
+ *CONFIG that comes next to CLIENT/SERVER means this is a axisc++ configuration
+ * related exception
+ */
+
/* Client faults */
- SF_MESSAGEINCOMPLETE,
- SF_SOAPACTIONEMPTY,
- SF_SERVICENOTFOUND,
- SF_SOAPCONTENTERROR,
- SF_NOSOAPMETHOD,
- SF_METHODNOTALLOWED,
- SF_PARATYPEMISMATCH,
- SF_CLIENTHANDLERFAILED,
+ CLIENT_SOAP_MESSAGEINCOMPLETE,
+ CLIENT_SOAP_SOAPACTIONEMTPY,
+ CLIENT_SOAP_SOAPCONTENTERROR,
+ CLIENT_SOAP_NOSOAPMETHOD,
+ CLIENT_WSDD_SERVICENOTFOUND,
+ CLIENT_WSDD_METHODNOTALLOWED,
+ CLIENT_WSDD_PARATYPEMISMATCH,
+ CLIENT_ENGINE_CLIENTHANDLERFAILED,
/* Server faults */
- SF_COULDNOTLOADSRV,
- SF_COULDNOTLOADHDL,
- SF_HANDLERFAILED,
- SF_WEBSERVICEFAILED,
- AXISC_TRANSPORT_CONF_ERROR,
- HANDLER_INIT_FAIL,
- HANDLER_CREATION_FAILED,
- LOADLIBRARY_FAILED,
- LIBRARY_PATH_EMPTY,
- HANDLER_NOT_LOADED,
- HANDLER_BEING_USED,
- GET_HANDLER_FAILED,
- WRONG_HANDLER_TYPE,
- NO_HANDLERS_CONFIGURED,
- AXISC_UNKNOWN_ERROR,
+ SERVER_ENGINE_EXCEPTION,
+ SERVER_ENGINE_COULDNOTLOADSRV,
+ SERVER_ENGINE_COULDNOTLOADHDL,
+ SERVER_ENGINE_HANDLERFAILED,
+ SERVER_ENGINE_WEBSERVICEFAILED,
+ SERVER_ENGINE_HANDLERINITFAILED,
+ SERVER_ENGINE_HANDLERCREATIONFAILED,
+ SERVER_ENGINE_LIBRARYLOADINGFAILED,
+ SERVER_ENGINE_HANDLERNOTLOADED,
+ SERVER_ENGINE_HANDLERBEINGUSED,
+ SERVER_ENGINE_GETHANDLERFAILED,
+ SERVER_ENGINE_WRONGHANDLERTYPE,
+ SERVER_CONFIG_EXCEPTION,
+ SERVER_CONFIG_TRANSPORTCONFFAILED,
+ SERVER_CONFIG_LIBRARYPATHEMPTY,
+ SERVER_WSDD_EXCEPTION,
+ SERVER_WSDD_NOHANDLERSCONFIGURED,
+ SERVER_SOAP_EXCEPTION,
+ SERVER_TRANSPORT_EXCEPTION,
+ SERVER_TRANSPORT_RECEPTIONEXCEPTION,
+ SERVER_TRANSPORT_SENDINGEXCEPTION,
+ SERVER_TRANSPORT_HTTP_EXCEPTION,
+
+ SERVER_TESTEXCEPTION,
+ SERVER_UNKNOWN_ERROR,
+ /*Following exceptions are not releated to soap faults
+ */
+ AXISC_UNKNOWN_ELEMENT_EXCEPTION,
+ AXISC_SOAP_FAULT_EXCEPTION,
/*
* This FAULT_LAST is not used as a fault code, but instead is used
* internaly in the code. Developers should not use this as a fault
* code.
*/
- FAULT_LAST,
-
- /*
- * Exceptions that appear afterwords are not related to Soap faults
- */
- AXISC_SOAP_EXCEPTION,
- AXISC_WSDD_EXCEPTION,
- AXISC_CONFIG_EXCEPTION,
- AXISC_ENGINE_EXCEPTION,
- AXISC_ERROR_NONE,
- AXISC_TEST_EXCEPTION,
- AXISC_RECEPTION_ERROR,
- AXISC_SENDING_ERROR,
- AXISC_HTTP_ERROR,
- AXISC_TEST_ERROR
-
+ FAULT_LAST
};
class AxisException :public exception
{
public:
+ AxisException(){};
+ AxisException(void* pMsg);
AxisException(int iExceptionCode);
AxisException(exception* e);
AxisException(exception* e, int iExceptionCode);
1.14 +78 -4 ws-axis/c/include/axis/server/IWrapperSoapSerializer.h
Index: IWrapperSoapSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/IWrapperSoapSerializer.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- IWrapperSoapSerializer.h 12 May 2004 07:36:46 -0000 1.13
+++ IWrapperSoapSerializer.h 18 May 2004 04:32:30 -0000 1.14
@@ -32,40 +32,60 @@
{
int (AXISCALL* createSoapMethod)(void* pObj, const AxisChar* sLocalName,
const AxisChar* sURI);
+
+ int (AXISCALL* createSoapFault)(void* pObj, const AxisChar* sLocalName,
+ const AxisChar* sURI);
+
const AxisChar* (AXISCALL* getNamespacePrefix)(void* pObj,
const AxisChar* pNamespace);
+
void (AXISCALL* removeNamespacePrefix)(void* pObj,
const AxisChar* pNamespace);
+
/* for basic types */
int (AXISCALL* addOutputParam)(void* pObj, const AxisChar* pchName,
void* pValue, XSDTYPE type);
+
/* for arrays */
int (AXISCALL* addOutputCmplxArrayParam)(void* pObj,
const Axis_Array* pArray, void* pSZFunct, void* pDelFunct,
void* pSizeFunct, const AxisChar* pName, const AxisChar* pNamespace);
+
int (AXISCALL* addOutputBasicArrayParam)(void* pObj,
const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pName);
+
/* for complex types */
int (AXISCALL* addOutputCmplxParam)(void* pObj, void* pObject,
void* pSZFunct, void* pDelFunct, const AxisChar* pName,
const AxisChar* pNamespace);
+
+ int (AXISCALL* addFaultDetail)(void* pObj, void* pObject, void* pSZFunct,
+ void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace );
+
/* Methods used to serialize arrays */
int (AXISCALL* serializeCmplxArray)(void* pObj, const Axis_Array* pArray,
void* pSZFunct, void* pDelFunct, void* pSizeFunct,
const AxisChar* pName, const AxisChar* pNamespace);
+
int (AXISCALL* serializeBasicArray)(void* pObj,
const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pName);
+
/* Basic Type Serializing methods */
int (AXISCALL* serializeAsElement)(void* pObj, const AxisChar* sName,
void* pValue, XSDTYPE type);
+
int (AXISCALL* serializeAsAttribute)(void* pObj, const AxisChar* sName,
const AxisChar* pNamespace, void* pValue, XSDTYPE type);
+
void (AXISCALL* serialize)(void* pObj, const char* pFirst);
+
void (AXISCALL* serializeStartElementOfType)(void* pObj,
const AxisChar* pName, const AxisChar* pNamespace,
const AxisChar* pPrefix);
+
void (AXISCALL* serializeEndElementOfType)(void* pObj,
const AxisChar* pName);
+
}IWrapperSoapSerializerFunctions;
typedef struct
@@ -91,120 +111,174 @@
{
public:
virtual ~IWrapperSoapSerializer(){};
+
virtual int AXISCALL createSoapMethod(const AxisChar* sLocalName,
const AxisChar* sURI)=0;
+
+ virtual int AXISCALL createSoapFault(const AxisChar* sLocalName,
+ const AxisChar* sURI)=0;
+
virtual const AxisChar* AXISCALL getNamespacePrefix
(const AxisChar* pNamespace)=0;
+
virtual void AXISCALL removeNamespacePrefix(const AxisChar* pNamespace)=0;
+
/* for basic types */
virtual int AXISCALL addOutputParam(const AxisChar* pchName, void* pValue,
XSDTYPE type)=0;
+
/* for arrays */
virtual int AXISCALL addOutputCmplxArrayParam(const Axis_Array* pArray,
void* pSZFunct, void* pDelFunct, void* pSizeFunct,
const AxisChar* pName, const AxisChar* pNamespace)=0;
+
virtual int AXISCALL addOutputBasicArrayParam(const Axis_Array* pArray,
XSDTYPE nType, const AxisChar* pName)=0;
+
/* for complex types */
virtual int AXISCALL addOutputCmplxParam(void* pObject, void* pSZFunct,
- void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace)=0;
+ void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace) = 0;
+
+ virtual int AXISCALL addFaultDetail(void* pObject, void* pSZFunct,
+ void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace) = 0;
+
/* Methods used to serialize arrays */
virtual int AXISCALL serializeCmplxArray(const Axis_Array* pArray,
void* pSZFunct, void* pDelFunct, void* pSizeFunct,
const AxisChar* pName, const AxisChar* pNamespace)=0;
+
virtual int AXISCALL serializeBasicArray
(const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pName)=0;
+
/* Basic Type Serializing methods */
virtual int AXISCALL serializeAsElement(const AxisChar* sName,
void* pValue, XSDTYPE type)=0;
+
virtual int AXISCALL serializeAsAttribute(const AxisChar* sName,
const AxisChar* pNamespace, void* pValue, XSDTYPE type)=0;
+
virtual void AXISCALL serialize(const char* pFirst, ...)=0;
+
/*
* following two functions are needed by serializer
* functions of complex types for RPC style web services
*/
virtual void AXISCALL serializeStartElementOfType(const AxisChar* pName,
const AxisChar* pNamespace, const AxisChar* pPrefix)=0;
+
virtual void AXISCALL serializeEndElementOfType(const AxisChar* pName)=0;
/* Externalization of serializer API */
virtual int setOutputStream(SOAPTransport* pStream)=0;
+
virtual void markEndOfStream()=0;
+
virtual int init()=0;
+
virtual PROVIDERTYPE getCurrentProviderType()=0;
+
virtual void setCurrentProviderType(PROVIDERTYPE nType)=0;
+
virtual void setStyle(AXIS_BINDING_STYLE nStyle)=0;
+
virtual AXIS_BINDING_STYLE getStyle()=0;
/* following stuff is needed to provide the interface for C web services */
public:
static IWrapperSoapSerializerFunctions ms_VFtable;
+
static int AXISCALL s_CreateSoapMethod(void* pObj,
const AxisChar* sLocalName, const AxisChar* sURI)
{ return ((IWrapperSoapSerializer*)pObj)->createSoapMethod
(sLocalName, sURI);};
+
+ static int AXISCALL s_CreateSoapFault(void* pObj,
+ const AxisChar* sLocalName, const AxisChar* sURI)
+ { return ((IWrapperSoapSerializer*)pObj)->createSoapFault
+ (sLocalName, sURI);};
+
static const AxisChar* AXISCALL s_GetNamespacePrefix(void* pObj,
const AxisChar* pNamespace)
{ return ((IWrapperSoapSerializer*)pObj)->getNamespacePrefix(pNamespace);};
+
static void AXISCALL s_RemoveNamespacePrefix(void* pObj,
const AxisChar* pNamespace)
{ ((IWrapperSoapSerializer*)pObj)->removeNamespacePrefix(pNamespace);};
+
static int AXISCALL s_AddOutputParam(void* pObj, const AxisChar* pchName,
void* pValue, XSDTYPE type)
{ return ((IWrapperSoapSerializer*)pObj)->addOutputParam
- (pchName, pValue, type);};
+ (pchName, pValue, type);};
+
static int AXISCALL s_AddOutputCmplxArrayParam(void* pObj,
const Axis_Array* pArray, void* pSZFunct, void* pDelFunct,
void* pSizeFunct, const AxisChar* pName, const AxisChar* pNamespace)
{ return ((IWrapperSoapSerializer*)pObj)->addOutputCmplxArrayParam
(pArray, pSZFunct, pDelFunct, pSizeFunct, pName, pNamespace);};
+
static int AXISCALL s_AddOutputBasicArrayParam(void* pObj,
const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pName)
{ return ((IWrapperSoapSerializer*)pObj)->addOutputBasicArrayParam
(pArray, nType, pName);};
+
static int AXISCALL s_AddOutputCmplxParam(void* pObj, void* pObject,
void* pSZFunct, void* pDelFunct, const AxisChar* pName,
const AxisChar* pNamespace)
- { return ((IWrapperSoapSerializer*)pObj)->addOutputCmplxParam
- (pObject, pSZFunct, pDelFunct, pName, pNamespace);};
+ { return ((IWrapperSoapSerializer*)pObj)->addOutputCmplxParam
+ (pObject, pSZFunct, pDelFunct, pName, pNamespace);};
+
+ static int AXISCALL s_AddFaultDetail(void* pObj, void* pObject,
+ void* pSZFunct, void* pDelFunct, const AxisChar* pName,
+ const AxisChar* pNamespace)
+ { return ((IWrapperSoapSerializer*)pObj)->addFaultDetail
+ (pObject, pSZFunct, pDelFunct, pName, pNamespace);};
+
static int AXISCALL s_SerializeCmplxArray(void* pObj,
const Axis_Array* pArray, void* pSZFunct, void* pDelFunct,
void* pSizeFunct, const AxisChar* pName, const AxisChar* pNamespace)
{ return ((IWrapperSoapSerializer*)pObj)->serializeCmplxArray
(pArray, pSZFunct, pDelFunct, pSizeFunct, pName, pNamespace);};
+
static int AXISCALL s_SerializeBasicArray(void* pObj,
const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pName)
{ return ((IWrapperSoapSerializer*)pObj)->serializeBasicArray
(pArray, nType, pName);};
+
static int AXISCALL s_SerializeAsElement(void* pObj,
const AxisChar* sName, void* pValue, XSDTYPE type)
{ return ((IWrapperSoapSerializer*)pObj)->serializeAsElement
(sName, pValue, type);};
+
static int AXISCALL s_SerializeAsAttribute(void* pObj,
const AxisChar* sName, const AxisChar* pNamespace,
void* pValue, XSDTYPE type)
{ return ((IWrapperSoapSerializer*)pObj)->serializeAsAttribute
(sName, pNamespace, pValue, type);};
+
static void AXISCALL s_Serialize(void* pObj, const char* pFirst)
{ ((IWrapperSoapSerializer*)pObj)->serialize(pFirst, 0);};
+
static void AXISCALL s_SerializeStartElementOfType(void* pObj,
const AxisChar* pName, const AxisChar* pNamespace,
const AxisChar* pPrefix)
{ ((IWrapperSoapSerializer*)pObj)->serializeStartElementOfType
(pName, pNamespace, pPrefix);}
+
static void AXISCALL s_SerializeEndElementOfType(void* pObj,
const AxisChar* pName)
{ ((IWrapperSoapSerializer*)pObj)->serializeEndElementOfType(pName);}
+
static void s_Initialize()
{
ms_VFtable.createSoapMethod = s_CreateSoapMethod;
+ ms_VFtable.createSoapFault = s_CreateSoapFault;
ms_VFtable.getNamespacePrefix = s_GetNamespacePrefix;
ms_VFtable.removeNamespacePrefix = s_RemoveNamespacePrefix;
ms_VFtable.addOutputParam = s_AddOutputParam;
ms_VFtable.addOutputCmplxArrayParam = s_AddOutputCmplxArrayParam;
ms_VFtable.addOutputBasicArrayParam = s_AddOutputBasicArrayParam;
ms_VFtable.addOutputCmplxParam = s_AddOutputCmplxParam;
+ ms_VFtable.addFaultDetail = s_AddFaultDetail;
ms_VFtable.serializeCmplxArray = s_SerializeCmplxArray;
ms_VFtable.serializeBasicArray = s_SerializeBasicArray;
ms_VFtable.serializeAsElement = s_SerializeAsElement;
1.16 +1 -0 ws-axis/c/include/axis/server/SoapDeSerializer.h
Index: SoapDeSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapDeSerializer.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SoapDeSerializer.h 12 May 2004 07:36:46 -0000 1.15
+++ SoapDeSerializer.h 18 May 2004 04:32:30 -0000 1.16
@@ -24,6 +24,7 @@
#include "XMLParser.h"
#include "AnyElement.h"
#include <axis/SOAPTransport.h>
+#include <axis/server/AxisException.h>
class SoapFault;
class SoapMethod;
1.16 +13 -2 ws-axis/c/include/axis/server/SoapSerializer.h
Index: SoapSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapSerializer.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SoapSerializer.h 12 May 2004 07:36:46 -0000 1.15
+++ SoapSerializer.h 18 May 2004 04:32:30 -0000 1.16
@@ -85,7 +85,10 @@
int setOutputStreamForTesting(SOAPTransport* pStream);
int AXISCALL createSoapMethod(const AxisChar* sLocalName,
- const AxisChar* sURI);
+ const AxisChar* sURI);
+
+ int AXISCALL createSoapFault(const AxisChar* sLocalName,
+ const AxisChar* sURI);
/* IWrapperSoapSerializer& operator<<(const char* cSerialized); */
IWrapperSoapSerializer& operator<<(const AxisChar* cSerialized);
@@ -111,26 +114,34 @@
int init();
int setOutputStream(SOAPTransport* pStream);
void markEndOfStream();
- int setSoapFault(SoapFault* pSoapFault);
int setSoapMethod(SoapMethod* pSoapMethod);
+ int setSoapFault(SoapFault* pSoapFault);
int setSoapBody(SoapBody* pSoapBody);
int setSoapHeader(SoapHeader* pSoapHeader);
int setSoapEnvelope(SoapEnvelope* pSoapEnvelope);
SoapSerializer();
virtual ~SoapSerializer();
+
/* for arrays of basic types */
int AXISCALL addOutputBasicArrayParam(const Axis_Array* pArray,
XSDTYPE nType, const AxisChar* pName);
+
/* for arrays of complex types */
int AXISCALL addOutputCmplxArrayParam(const Axis_Array* pArray,
void* pSZFunct, void* pDelFunct, void* pSizeFunct,
const AxisChar* pName, const AxisChar* pNamespace);
+
/* for complex types */
int AXISCALL addOutputCmplxParam(void* pObject, void* pSZFunct,
void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace);
+
+ int AXISCALL addFaultDetail(void* pObject, void* pSZFunct,
+ void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace );
+
int AXISCALL serializeCmplxArray(const Axis_Array* pArray, void* pSZFunct,
void* pDelFunct, void* pSizeFunct, const AxisChar* pName,
const AxisChar* pNamespace);
+
int AXISCALL serializeBasicArray(const Axis_Array* pArray, XSDTYPE nType,
const AxisChar* pName);
/* following two functions are needed by serializer functions of complex
1.2 +3 -4 ws-axis/c/samples/server/rpcfault/MathOps.cpp
Index: MathOps.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/rpcfault/MathOps.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOps.cpp 13 May 2004 12:20:30 -0000 1.1
+++ MathOps.cpp 18 May 2004 04:32:30 -0000 1.2
@@ -5,7 +5,6 @@
*/
#include "MathOps.h"
-
MathOps::MathOps()
{
}
@@ -14,8 +13,8 @@
{
}
-int MathOps::div(int Value0, int Value1)
+int MathOps::div(int Value0, int Value1) throw(AxisDivByZeroException)
{
- if (Value1 == 0) return -1; /* :)) */
- return Value0/Value1;
+ if (Value1 == 0) throw AxisDivByZeroException();
+ return Value0/Value1;
}
1.2 +8 -11 ws-axis/c/samples/server/rpcfault/MathOps.h
Index: MathOps.h
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/rpcfault/MathOps.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOps.h 13 May 2004 12:20:30 -0000 1.1
+++ MathOps.h 18 May 2004 04:32:30 -0000 1.2
@@ -7,19 +7,16 @@
#define __MATHOPS_SERVERSKELETON_H__OF_AXIS_INCLUDED_
#include <axis/server/AxisUserAPI.h>
-
+#include "AxisDivByZeroException.h"
class MathOps
{
- public:
- MathOps();
- public:
- virtual ~MathOps();
- public:
- int add(int Value0,int Value1);
- int sub(int Value0,int Value1);
- int mul(int Value0,int Value1);
- int div(int Value0,int Value1);
+public:
+ MathOps();
+public:
+ virtual ~MathOps();
+public:
+ int div(int Value0,int Value1) throw(AxisDivByZeroException);
};
-#endif /* !defined(__CALCULATOR_SERVERSKELETON_H__OF_AXIS_INCLUDED_)*/
+#endif /* !defined(__MATHOPS_SERVERSKELETON_H__OF_AXIS_INCLUDED_)*/
1.2 +4 -4 ws-axis/c/samples/server/rpcfault/MathOps.wsdl
Index: MathOps.wsdl
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/rpcfault/MathOps.wsdl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOps.wsdl 13 May 2004 12:20:30 -0000 1.1
+++ MathOps.wsdl 18 May 2004 04:32:30 -0000 1.2
@@ -22,7 +22,7 @@
</complexType>
<complexType name="SOAPStructFault">
<sequence>
- <element name="soapStruct" type="tns:SOAPStruct"/>
+ <element name="soapStruct" type="intf:SOAPStruct"/>
</sequence>
</complexType>
</schema>
@@ -35,13 +35,13 @@
<wsdl:part name="addReturn" type="xsd:int"/>
</wsdl:message>
<message name="SOAPStructFault">
- <part name="part1" type="s:SOAPStructFault"/>
+ <part name="faultstruct" type="s:SOAPStructFault"/>
</message>
<wsdl:portType name="MathOps">
<wsdl:operation name="div" parameterOrder="in0 in1">
<wsdl:input message="intf:divRequest" name="divRequest"/>
<wsdl:output message="intf:divResponse" name="divResponse"/>
- <fault name="DivByZeroFault" message="tns:SOAPStructFault"/>
+ <fault name="DivByZeroFault" message="intf:SOAPStructFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MathOpsSoapBinding" type="intf:MathOps">
@@ -61,7 +61,7 @@
namespace="http://localhost/axis/MathOps"
use="encoded"/>
</wsdl:output>
- <fault name="ComplexFault">
+ <fault name="DivByZeroFault">
<soap:fault name="DivByZeroFault" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://soapinterop.org/wsdl"/>
</fault>
1.2 +25 -9 ws-axis/c/samples/server/rpcfault/MathOpsWrapper.cpp
Index: MathOpsWrapper.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/rpcfault/MathOpsWrapper.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOpsWrapper.cpp 13 May 2004 12:20:30 -0000 1.1
+++ MathOpsWrapper.cpp 18 May 2004 04:32:30 -0000 1.2
@@ -6,6 +6,20 @@
#include "MathOpsWrapper.h"
+extern int Axis_DeSerialize_SOAPStructFault(SOAPStructFault* param,
+ IWrapperSoapDeSerializer *pDZ);
+
+extern void* Axis_Create_SOAPStructFault(SOAPStructFault *Obj, bool bArray = false,
+ int nSize=0);
+
+extern void Axis_Delete_SOAPStructFault(SOAPStructFault* param, bool bArray = false,
+ int nSize=0);
+
+extern int Axis_Serialize_SOAPStructFault(SOAPStructFault* param, IWrapperSoapSerializer* pSZ,
+ bool bArray = false);
+
+extern int Axis_GetSize_SOAPStructFault();
+
MathOpsWrapper::MathOpsWrapper()
{
pWs = new MathOps();
@@ -39,13 +53,7 @@
{
IMessageData* mc = (IMessageData*)pMsg;
const AxisChar *method = mc->getOperationName();
- if (0 == strcmp(method, "add"))
- return add(mc);
- else if (0 == strcmp(method, "sub"))
- return sub(mc);
- else if (0 == strcmp(method, "mul"))
- return mul(mc);
- else if (0 == strcmp(method, "div"))
+ if (0 == strcmp(method, "div"))
return div(mc);
else return AXIS_FAIL;
}
@@ -56,10 +64,11 @@
/*
* This method wrap the service method
*/
-int MathOpsWrapper::div(void* pMsg)
+int MathOpsWrapper::div(void* pMsg) throw(AxisDivByZeroException)
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
+ int ret;
IWrapperSoapSerializer *pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
@@ -72,7 +81,14 @@
int v0 = pIWSDZ->getElementAsInt("in0",0);
int v1 = pIWSDZ->getElementAsInt("in1",0);
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus())) return nStatus;
- int ret = pWs->div(v0,v1);
+ try
+ {
+ ret = pWs->div(v0,v1);
+ }
+ catch(AxisDivByZeroException& e)
+ {
+ throw AxisDivByZeroException(pMsg);
+ }
return pIWSSZ->addOutputParam("divReturn", (void*)&ret, XSD_INT);
}
1.2 +3 -1 ws-axis/c/samples/server/rpcfault/MathOpsWrapper.h
Index: MathOpsWrapper.h
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/rpcfault/MathOpsWrapper.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MathOpsWrapper.h 13 May 2004 12:20:30 -0000 1.1
+++ MathOpsWrapper.h 18 May 2004 04:32:30 -0000 1.2
@@ -7,10 +7,12 @@
#define __MATHOPSWRAPPER_SERVERWRAPPER_H__OF_AXIS_INCLUDED_
#include "MathOps.h"
+#include "SOAPStructFault.h"
#include <axis/server/WrapperClassHandler.h>
#include <axis/server/IMessageData.h>
#include <axis/server/GDefine.h>
#include <axis/server/AxisWrapperAPI.h>
+#include "AxisDivByZeroException.h"
class MathOpsWrapper : public WrapperClassHandler
{
@@ -27,7 +29,7 @@
int AXISCALL fini();
AXIS_BINDING_STYLE AXISCALL getBindingStyle(){return RPC_ENCODED;};
private:/*Methods corresponding to the web service methods*/
- int div(void* pMsg);
+ int div(void* pMsg) throw(AxisDivByZeroException);
};
#endif /* !defined(__CALCULATORWRAPPER_SERVERWRAPPER_H__OF_AXIS_INCLUDED_)*/
1.2 +51 -3 ws-axis/c/src/common/AxisConfigException.cpp
Index: AxisConfigException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/common/AxisConfigException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AxisConfigException.cpp 13 May 2004 12:18:31 -0000 1.1
+++ AxisConfigException.cpp 18 May 2004 04:32:30 -0000 1.2
@@ -19,17 +19,17 @@
*
*/
-#include <axis/server/AxisConfigException.h>
+#include "AxisConfigException.h"
#include <exception>
using namespace std;
/**
* Default when no parameter passed. When thrown with no parameter
- * more general AXISC_CONFIG_EXCEPTION is assumed.
+ * more general SERVER_CONFIG_EXCEPTION is assumed.
*/
AxisConfigException::AxisConfigException()
{
- processException(AXISC_CONFIG_EXCEPTION);
+ processException(SERVER_CONFIG_EXCEPTION);
}
AxisConfigException::AxisConfigException (int iExceptionCode)
@@ -53,3 +53,51 @@
}
+void AxisConfigException::processException (exception* e, int iExceptionCode)
+{
+ m_sMessage = getMessage (e) + getMessage (iExceptionCode);
+}
+
+void AxisConfigException::processException (exception* e)
+{
+ m_sMessage = getMessage (e);
+}
+
+void AxisConfigException::processException(int iExceptionCode)
+{
+ m_sMessage = getMessage (iExceptionCode);
+}
+
+const string AxisConfigException::getMessage (exception* objException)
+{
+ string sMessage = objException->what();
+
+ return sMessage;
+}
+
+const string AxisConfigException::getMessage (int iExceptionCode)
+{
+ string sMessage;
+ switch(iExceptionCode)
+ {
+ case SERVER_CONFIG_TRANSPORTCONFFAILED:
+ sMessage = "Transport layer is not configured properly";
+ break;
+ case SERVER_CONFIG_LIBRARYPATHEMPTY:
+ sMessage = "Library path is empty(Not in server.wsdd file)";
+ break;
+ default:
+ sMessage = "Unknown Axis C++ Configuration Exception";
+ }
+ return sMessage;
+}
+
+const char* AxisConfigException::what() throw ()
+{
+ return m_sMessage.c_str ();
+}
+
+const int AxisConfigException::getExceptionCode()
+{
+ return m_iExceptionCode;
+}
1.16 +4 -104 ws-axis/c/src/common/AxisException.cpp
Index: AxisException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/common/AxisException.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- AxisException.cpp 14 May 2004 12:19:27 -0000 1.15
+++ AxisException.cpp 18 May 2004 04:32:30 -0000 1.16
@@ -57,31 +57,6 @@
const string AxisException::getMessage (exception* objException)
{
string sMessage = objException->what();
- /* to do */
-/* exception *objType = static_cast<std::bad_alloc*> (e);
- if(objType != NULL)
- {
- sMessage = "thrown by new";
- }
-
- objType = static_cast<std::bad_cast*> (e);
- if(objType != NULL)
- {
- sMessage = "thrown by dynamic_cast when fails with a referenced type";
- }
-
- objType = static_cast<bad_exception*> (e);
- if(objType != NULL)
- {
- sMessage = "thrown when an exception doesn't match any catch";
- }
-
- objType = static_cast<bad_typeid*> (e);
- if(objType != NULL)
- {
- sMessage = "thrown by typeid";
- }
-*/
return sMessage;
}
@@ -91,92 +66,17 @@
string sMessage;
switch(iExceptionCode)
{
- case SF_VERSION_MISMATCH:
+ case SOAP_VERSIONMISMATCH :
sMessage = "Soap Version mismatch fault occured";
break;
- case SF_MUST_UNDERSTAND:
+ case SOAP_MUSTUNDERSTAND:
sMessage = "Soap Must understand fault occured";
break;
- case SF_MESSAGEINCOMPLETE:
- sMessage = "Received message is incomplete";
- break;
- case SF_SOAPACTIONEMPTY:
- sMessage = "Soap action is empty";
- break;
- case SF_SERVICENOTFOUND:
- sMessage = "Requested service not found";
- break;
- case SF_SOAPCONTENTERROR:
- sMessage = "Received content is faulty";
- break;
- case SF_NOSOAPMETHOD:
- sMessage = "Request method is not a soap method";
- break;
- case SF_METHODNOTALLOWED:
- sMessage = "Requested method is not allowed";
- break;
- case SF_PARATYPEMISMATCH:
- sMessage = "Parameter type mismatch";
- break;
- case SF_CLIENTHANDLERFAILED:
- sMessage = "Client handler failed";
- case SF_COULDNOTLOADSRV:
- sMessage = "Could not load service";
- break;
- case SF_COULDNOTLOADHDL:
- sMessage = "Could not load handler";
- break;
- break;
- case SF_HANDLERFAILED:
- sMessage = "Handler failed";
- break;
- case SF_WEBSERVICEFAILED:
- sMessage = "Web Service failed";
- break;
- case AXISC_RECEPTION_ERROR:
- sMessage = "Problem occured when receiving the stream";
- break;
- case AXISC_SENDING_ERROR:
- sMessage = "Problem occured when sending the stream";
- break;
- case AXISC_HTTP_ERROR:
- sMessage = "HTTP transport error";
- break;
- case AXISC_TRANSPORT_CONF_ERROR:
- sMessage = "Transport layer is not configured properly";
- break;
- case HANDLER_INIT_FAIL:
- sMessage = "Handler initialization failed";
- break;
- case HANDLER_CREATION_FAILED:
- sMessage = "Handler creation failed";
- break;
- case LOADLIBRARY_FAILED:
- sMessage = "Library loading failed";
- break;
- case LIBRARY_PATH_EMPTY:
- sMessage = "Library path is empty(Not in server.wsdd file)";
- break;
- case HANDLER_NOT_LOADED:
- sMessage = "Handler is not loaded";
- break;
- case HANDLER_BEING_USED:
- sMessage = "Handler is being used";
- break;
- case GET_HANDLER_FAILED:
- sMessage = "Get handler failed";
- break;
- case WRONG_HANDLER_TYPE:
- sMessage = "Wrong handler type";
- break;
- case NO_HANDLERS_CONFIGURED:
- sMessage = "No handlers configured in server.wsdd";
- break;
- case AXISC_TEST_ERROR:
+ case SERVER_TESTEXCEPTION:
sMessage = "This is a testing error";
break;
default:
- sMessage = "Unknown error has occured";
+ sMessage = "Unknown Exception has occured";
}
1.16 +13 -4 ws-axis/c/src/common/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/common/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Makefile.am 14 May 2004 08:30:18 -0000 1.15
+++ Makefile.am 18 May 2004 04:32:30 -0000 1.16
@@ -1,9 +1,18 @@
noinst_LTLIBRARIES = libcommon.la
AM_CPPFLAGS = $(CPPFLAGS)
-libcommon_la_SOURCES = Param.cpp TypeMapping.cpp MessageData.cpp \
- BasicTypeSerializer.cpp ArrayBean.cpp AxisTime.cpp \
- GDefine.cpp AxisUtils.cpp AxisTrace.cpp AxisException.cpp AxisConfig.cpp \
- AxisSocketUtils.cpp AdminUtils.cpp
+libcommon_la_SOURCES = Param.cpp \
+ TypeMapping.cpp \
+ MessageData.cpp \
+ BasicTypeSerializer.cpp \
+ ArrayBean.cpp AxisTime.cpp \
+ GDefine.cpp \
+ AxisUtils.cpp \
+ AxisTrace.cpp \
+ AxisException.cpp \
+ AxisConfig.cpp \
+ AxisSocketUtils.cpp \
+ AdminUtils.cpp \
+ AxisConfigException.cpp
libcommon_la_LIBADD = $(LDFLAGS)
INCLUDES = -I$(AXISCPP_HOME)/include
1.12 +2 -2 ws-axis/c/src/engine/AppScopeHandlerPool.cpp
Index: AppScopeHandlerPool.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/AppScopeHandlerPool.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AppScopeHandlerPool.cpp 6 May 2004 03:55:19 -0000 1.11
+++ AppScopeHandlerPool.cpp 18 May 2004 04:32:30 -0000 1.12
@@ -64,11 +64,11 @@
if (m_Handlers[nLibId].empty ())
/* this means that the object is being used by some other thread
* but we cannot create any more objects because this is an
- * application scope object. So just return HANDLER_BEING_USED
+ * application scope object. So just return SERVER_ENGINE_HANDLERBEINGUSED
*/
{
unlock ();
- return HANDLER_BEING_USED;
+ return SERVER_ENGINE_HANDLERBEINGUSED;
}
else
{
1.52 +1 -1 ws-axis/c/src/engine/Axis.cpp
Index: Axis.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/Axis.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- Axis.cpp 12 May 2004 07:36:46 -0000 1.51
+++ Axis.cpp 18 May 2004 04:32:30 -0000 1.52
@@ -41,7 +41,7 @@
#include <string>
#include <map>
-#include <axis/server/SoapFault.h>
+#include "../soap/SoapFault.h"
#include "../soap/URIMapping.h"
#include "../soap/SoapKeywordMapping.h"
#include "HandlerLoader.h"
1.2 +79 -3 ws-axis/c/src/engine/AxisEngineException.cpp
Index: AxisEngineException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/AxisEngineException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AxisEngineException.cpp 14 May 2004 12:19:27 -0000 1.1
+++ AxisEngineException.cpp 18 May 2004 04:32:30 -0000 1.2
@@ -19,17 +19,17 @@
*
*/
-#include <axis/server/AxisEngineException.h>
+#include "AxisEngineException.h"
#include <exception>
using namespace std;
/**
* Default when no parameter passed. When thrown with no parameter
- * more general AXISC_ENGINE_EXCEPTION is assumed.
+ * more general SERVER_ENGINE_EXCEPTION is assumed.
*/
AxisEngineException::AxisEngineException()
{
- processException(AXISC_ENGINE_EXCEPTION);
+ processException(SERVER_ENGINE_EXCEPTION);
}
AxisEngineException::AxisEngineException (int iExceptionCode)
@@ -51,5 +51,81 @@
AxisEngineException::~AxisEngineException() throw ()
{
+}
+
+void AxisEngineException::processException (exception* e, int iExceptionCode)
+{
+ m_sMessage = getMessage (e) + getMessage (iExceptionCode);
+}
+
+void AxisEngineException::processException (exception* e)
+{
+ m_sMessage = getMessage (e);
+}
+
+void AxisEngineException::processException(int iExceptionCode)
+{
+ m_sMessage = getMessage (iExceptionCode);
+}
+
+const string AxisEngineException::getMessage (exception* objException)
+{
+ string sMessage = objException->what();
+
+ return sMessage;
+}
+
+const string AxisEngineException::getMessage (int iExceptionCode)
+{
+ string sMessage;
+ switch(iExceptionCode)
+ {
+ case SERVER_ENGINE_COULDNOTLOADSRV:
+ sMessage = "Could not load service";
+ break;
+ case SERVER_ENGINE_COULDNOTLOADHDL:
+ sMessage = "Could not load handler";
+ break;
+ case SERVER_ENGINE_HANDLERFAILED:
+ sMessage = "Handler failed";
+ break;
+ case SERVER_ENGINE_WEBSERVICEFAILED:
+ sMessage = "Web Service failed";
+ break;
+ case SERVER_ENGINE_HANDLERINITFAILED:
+ sMessage = "Handler initialization failed";
+ break;
+ case SERVER_ENGINE_HANDLERCREATIONFAILED:
+ sMessage = "Handler creation failed";
+ break;
+ case SERVER_ENGINE_LIBRARYLOADINGFAILED:
+ sMessage = "Library loading failed";
+ break;
+ case SERVER_ENGINE_HANDLERNOTLOADED:
+ sMessage = "Handler is not loaded";
+ break;
+ case SERVER_ENGINE_HANDLERBEINGUSED:
+ sMessage = "Handler is being used";
+ break;
+ case SERVER_ENGINE_GETHANDLERFAILED:
+ sMessage = "Get handler failed";
+ break;
+ case SERVER_ENGINE_WRONGHANDLERTYPE:
+ sMessage = "Wrong handler type";
+ break;
+ default:
+ sMessage = "Unknown Axis C++ Engine Exception";
+ }
+ return sMessage;
+}
+
+const char* AxisEngineException::what() throw ()
+{
+ return m_sMessage.c_str ();
+}
+
+const int AxisEngineException::getExceptionCode()
+{
+ return m_iExceptionCode;
}
1.26 +22 -23 ws-axis/c/src/engine/HandlerLoader.cpp
Index: HandlerLoader.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/HandlerLoader.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- HandlerLoader.cpp 6 May 2004 03:55:19 -0000 1.25
+++ HandlerLoader.cpp 18 May 2004 04:32:30 -0000 1.26
@@ -27,7 +27,6 @@
#include <stdio.h>
#include "../common/AxisUtils.h"
#include "../wsdd/WSDDDeployment.h"
-#include <axis/server/AxisException.h>
#include <axis/server/AxisTrace.h>
extern AxisTrace* g_pAT;
@@ -76,7 +75,7 @@
else
{
unlock ();
- return HANDLER_NOT_LOADED;
+ return SERVER_ENGINE_HANDLERNOTLOADED;
}
}
@@ -88,7 +87,7 @@
if (!pHandlerInfo->m_Handler)
{
AXISTRACE1("DLOPEN FAILED", CRITICAL);
- AXISC_THROW(LOADLIBRARY_FAILED);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_LIBRARYLOADINGFAILED);
}
#elif defined(WIN32)
pHandlerInfo->m_Handler = LoadLibrary (pHandlerInfo->m_sLib.c_str ());
@@ -99,7 +98,7 @@
if (!pHandlerInfo->m_Handler)
{
AXISTRACE1("DLOPEN FAILED", CRITICAL);
- AXISC_THROW(LOADLIBRARY_FAILED);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_LIBRARYLOADINGFAILED);
//printf ("DLOPEN FAILED: %s\n", dlerror ());
//exit (1);
}
@@ -133,9 +132,9 @@
{
delete pHandlerInfo;
unlock ();
- AXISTRACE1("LIBRARY_PATH_EMPTY", CRITICAL);
- AXISC_THROW(LIBRARY_PATH_EMPTY);
- //return LIBRARY_PATH_EMPTY;
+ AXISTRACE1("SERVER_CONFIG_LIBRARYPATHEMPTY", CRITICAL);
+ THROW_AXIS_CONFIG_EXCEPTION(SERVER_CONFIG_LIBRARYPATHEMPTY);
+ //return SERVER_CONFIG_LIBRARYPATHEMPTY;
}
// pHandlerInfo->m_nLoadOptions = RTLD_LAZY;
if (AXIS_SUCCESS == loadLib (pHandlerInfo))
@@ -169,8 +168,8 @@
delete pHandlerInfo;
unlock ();
AXISTRACE1 ("Library loading failed", CRITICAL);
- AXISC_THROW(LOADLIBRARY_FAILED);
- //return LOADLIBRARY_FAILED;
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_LIBRARYLOADINGFAILED);
+ //return SERVER_ENGINE_LIBRARYLOADINGFAILED;
}
else // success
{
@@ -181,8 +180,8 @@
{
unlock ();
AXISTRACE1 ("Library loading failed", CRITICAL);
- AXISC_THROW(LOADLIBRARY_FAILED);
- //return LOADLIBRARY_FAILED;
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_LIBRARYLOADINGFAILED);
+ //return SERVER_ENGINE_LIBRARYLOADINGFAILED;
}
}
@@ -206,16 +205,16 @@
pBH->_functions->fini (pBH->_object);
pHandlerInfo->m_Delete (pBH);
unlock ();
- AXISTRACE1("HANDLER_INIT_FAIL", CRITICAL);
- AXISC_THROW(HANDLER_INIT_FAIL);
- //return HANDLER_INIT_FAIL;
+ AXISTRACE1("SERVER_ENGINE_HANDLERINITFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERINITFAILED);
+ //return SERVER_ENGINE_HANDLERINITFAILED;
}
}
else if (0 == pBH->_object)
{
- AXISTRACE1("HANDLER_CREATION_FAILED", CRITICAL);
- AXISC_THROW(HANDLER_CREATION_FAILED);
- //return HANDLER_CREATION_FAILED;
+ AXISTRACE1("SERVER_ENGINE_HANDLERCREATIONFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERCREATIONFAILED);
+ //return SERVER_ENGINE_HANDLERCREATIONFAILED;
}
else
/* C++ service or handler */
@@ -232,17 +231,17 @@
((HandlerBase*) pBH->_object)->fini ();
pHandlerInfo->m_Delete (pBH);
unlock ();
- AXISTRACE1("HANDLER_INIT_FAIL", CRITICAL);
- AXISC_THROW(HANDLER_INIT_FAIL);
- //return HANDLER_INIT_FAIL;
+ AXISTRACE1("SERVER_ENGINE_HANDLERINITFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERINITFAILED);
+ //return SERVER_ENGINE_HANDLERINITFAILED;
}
}
}
else
{
unlock ();
- AXISTRACE1("HANDLER_CREATION_FAILED", CRITICAL);
- AXISC_THROW(HANDLER_CREATION_FAILED);
- //return HANDLER_CREATION_FAILED;
+ AXISTRACE1("SERVER_ENGINE_HANDLERCREATIONFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERCREATIONFAILED);
+ //return SERVER_ENGINE_HANDLERCREATIONFAILED;
}
}
1.12 +2 -0 ws-axis/c/src/engine/HandlerLoader.h
Index: HandlerLoader.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/HandlerLoader.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- HandlerLoader.h 6 May 2004 03:55:19 -0000 1.11
+++ HandlerLoader.h 18 May 2004 04:32:30 -0000 1.12
@@ -23,6 +23,8 @@
#include <axis/server/GDefine.h>
#include <axis/server/WrapperClassHandler.h>
#include "SharedObject.h"
+#include "AxisEngineException.h"
+#include "../common/AxisConfigException.h"
#include <map>
#include <string>
1.27 +4 -4 ws-axis/c/src/engine/HandlerPool.cpp
Index: HandlerPool.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/HandlerPool.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- HandlerPool.cpp 6 May 2004 03:55:19 -0000 1.26
+++ HandlerPool.cpp 18 May 2004 04:32:30 -0000 1.27
@@ -65,7 +65,7 @@
{
return Status;
}
- else if (Status == HANDLER_BEING_USED)
+ else if (Status == SERVER_ENGINE_HANDLERBEINGUSED)
{ //block this thread not this object
Ax_Sleep (0);
}
@@ -73,7 +73,7 @@
{
return Status;
}
- } while (Status == HANDLER_BEING_USED);
+ } while (Status == SERVER_ENGINE_HANDLERBEINGUSED);
break;
case AH_SESSION:
return g_pSessionScopeHandlerPool->getInstance (sSessionId,
@@ -236,7 +236,7 @@
* }
* else
* {
- * Status = WRONG_HANDLER_TYPE;
+ * Status = SERVER_ENGINE_WRONGHANDLERTYPE;
* break;
* }
*/
@@ -256,7 +256,7 @@
}
else
{
- Status = WRONG_HANDLER_TYPE;
+ Status = SERVER_ENGINE_WRONGHANDLERTYPE;
break;
}
}
1.8 +5 -5 ws-axis/c/src/engine/client/ClientAxisEngine.cpp
Index: ClientAxisEngine.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/ClientAxisEngine.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ClientAxisEngine.cpp 12 May 2004 07:36:46 -0000 1.7
+++ ClientAxisEngine.cpp 18 May 2004 04:32:31 -0000 1.8
@@ -66,7 +66,7 @@
if (AXIS_SUCCESS !=
(Status = initializeHandlers (sSessionId, pSoap->getProtocol())))
{
- AXISC_THROW(HANDLER_INIT_FAIL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERINITFAILED);
break; //do .. while(0)
}
//Get Service specific Handlers from the pool if configured any
@@ -115,7 +115,7 @@
AXISC_CATCH(...)
#ifdef __ENABLE_AXIS_EXCEPTION__
- return AXISC_UNKNOWN_ERROR;
+ return SERVER_UNKNOWN_ERROR;
#endif
AXISC_ENDCATCH
return Status;
@@ -135,7 +135,7 @@
{
if (AXIS_SUCCESS != (Status = m_pSReqFChain->invoke (pMsg)))
{
- // m_pSZ->setSoapFault(SoapFault::getSoapFault(SF_CLIENTHANDLERFAILED));
+ // m_pSZ->setSoapFault(SoapFault::getSoapFault(CLIENT_ENGINE_CLIENTHANDLERFAILED));
break; //do .. while (0)
}
}
@@ -147,7 +147,7 @@
{
if (AXIS_SUCCESS != (Status = m_pGReqFChain->invoke (pMsg)))
{
- // m_pSZ->setSoapFault(SoapFault::getSoapFault(SF_CLIENTHANDLERFAILED));
+ // m_pSZ->setSoapFault(SoapFault::getSoapFault(CLIENT_ENGINE_CLIENTHANDLERFAILED));
break; //do .. while (0)
}
}
@@ -159,7 +159,7 @@
{
if (AXIS_SUCCESS != (Status = m_pTReqFChain->invoke (pMsg)))
{
- // m_pSZ->setSoapFault(SoapFault::getSoapFault(SF_CLIENTHANDLERFAILED));
+ // m_pSZ->setSoapFault(SoapFault::getSoapFault(CLIENT_ENGINE_CLIENTHANDLERFAILED));
break; //do .. while (0)
}
}
1.11 +2 -1 ws-axis/c/src/engine/client/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Makefile.am 14 May 2004 08:30:18 -0000 1.10
+++ Makefile.am 18 May 2004 04:32:31 -0000 1.11
@@ -13,7 +13,8 @@
../SessionScopeHandlerPool.cpp \
../SharedObject.cpp \
../../transport/SOAPTransportFactory.cpp \
- Call.cpp
+ Call.cpp \
+ ../AxisEngineException.cpp
libaxiscpp_client_la_LIBADD = $(LDFLAGS) ../../common/libcommon.la ../../soap/libsoap.la ../../wsdd/libwsdd.la ../../xml/libxml.la
INCLUDES = -I$(AXISCPP_HOME)/include
1.7 +2 -1 ws-axis/c/src/engine/server/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/server/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile.am 14 May 2004 08:30:19 -0000 1.6
+++ Makefile.am 18 May 2004 04:32:31 -0000 1.7
@@ -12,7 +12,8 @@
../SerializerPool.cpp \
../SessionScopeHandlerPool.cpp \
../SharedObject.cpp \
- ../../transport/SOAPTransportFactory.cpp
+ ../../transport/SOAPTransportFactory.cpp \
+ ../AxisEngineException.cpp
libserver_engine_la_LIBADD = $(LDFLAGS) ../../common/libcommon.la ../../soap/libsoap.la ../../wsdd/libwsdd.la ../../xml/libxml.la
INCLUDES = -I$(AXISCPP_HOME)/include
1.11 +73 -71 ws-axis/c/src/engine/server/ServerAxisEngine.cpp
Index: ServerAxisEngine.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/server/ServerAxisEngine.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServerAxisEngine.cpp 12 May 2004 07:36:46 -0000 1.10
+++ ServerAxisEngine.cpp 18 May 2004 04:32:31 -0000 1.11
@@ -19,7 +19,6 @@
#include "../../soap/SoapMethod.h"
#include "ServerAxisEngine.h"
#include <stdio.h>
-#include <axis/server/AxisException.h>
#include "../../common/AxisUtils.h"
#include "../../wsdd/WSDDDeployment.h"
#include "../HandlerPool.h"
@@ -49,7 +48,7 @@
if (!pStream)
{
AXISTRACE1 ("transport is not set properly", CRITICAL);
- AXISC_THROW(AXISC_TRANSPORT_CONF_ERROR);
+ THROW_AXIS_CONFIG_EXCEPTION(SERVER_CONFIG_TRANSPORTCONFFAILED);
}
string sSessionId = pStream->getSessionId();
@@ -68,18 +67,18 @@
nSoapVersion =
(nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
- AXISC_THROW(SF_SOAPCONTENTERROR);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPCONTENTERROR));
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPCONTENTERROR);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
const char* cService = pStream->getTransportProperty(SERVICE_URI);
if (!cService)
{
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
- AXISC_THROW(SF_SOAPCONTENTERROR);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPCONTENTERROR));
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPCONTENTERROR);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
AxisString service = (cService == NULL) ? "" : cService;
@@ -90,9 +89,9 @@
nSoapVersion =
(nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1("SF_SOAPACTIONEMPTY", CRITICAL);
- AXISC_THROW(SF_SOAPACTIONEMPTY);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPACTIONEMPTY));
+ AXISTRACE1("CLIENT_SOAP_SOAPACTIONEMTPY", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPACTIONEMTPY);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPACTIONEMTPY));
break; // do .. while(0)
}
/* if there are quotes remove them. */
@@ -109,9 +108,9 @@
nSoapVersion =
(nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1("SF_SERVICENOTFOUND", CRITICAL);
- AXISC_THROW(SF_SERVICENOTFOUND);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SERVICENOTFOUND));
+ AXISTRACE1("CLIENT_WSDD_SERVICENOTFOUND", CRITICAL);
+ THROW_AXIS_WSDD_EXCEPTION(CLIENT_WSDD_SERVICENOTFOUND);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_WSDD_SERVICENOTFOUND));
break; // do .. while(0)
}
@@ -146,27 +145,27 @@
nSoapVersion = m_pDZ->getVersion ();
if (m_pDZ->getStatus () != AXIS_SUCCESS)
{
- AXISTRACE1("SF_MESSAGEINCOMPLETE", CRITICAL);
- AXISC_THROW(SF_MESSAGEINCOMPLETE);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault(SF_MESSAGEINCOMPLETE));
+ AXISTRACE1("CLIENT_SOAP_MESSAGEINCOMPLETE", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_MESSAGEINCOMPLETE);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault(CLIENT_SOAP_MESSAGEINCOMPLETE));
break; // do .. while(0)
}
if (nSoapVersion == VERSION_LAST) /* version not supported */
{
m_pSZ->setSoapVersion (SOAP_VER_1_2);
- AXISTRACE1("SF_VERSION_MISMATCH", CRITICAL);
- AXISC_THROW(SF_VERSION_MISMATCH);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_VERSION_MISMATCH));
+ AXISTRACE1("SOAP_VERSIONMISMATCH", CRITICAL);
+ THROW_AXIS_EXCEPTION(SOAP_VERSIONMISMATCH);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (SOAP_VERSIONMISMATCH));
break; // do .. while(0)
}
/* Set Soap version in the Serializer and the envelope */
if (AXIS_SUCCESS != m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion))
{
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
- AXISC_THROW(SF_SOAPCONTENTERROR);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPCONTENTERROR));
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPCONTENTERROR);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
@@ -176,9 +175,9 @@
AxisString sOperation = pStream->getTransportProperty(OPERATION_NAME);
if (sOperation.empty ())
{
- AXISTRACE1("SF_NOSOAPMETHOD", CRITICAL);
- AXISC_THROW(SF_NOSOAPMETHOD);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_NOSOAPMETHOD));
+ AXISTRACE1("CLIENT_SOAP_NOSOAPMETHOD", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_NOSOAPMETHOD);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_NOSOAPMETHOD));
break; // do .. while(0)
}
/* remove any quotes in the operation name */
@@ -196,10 +195,10 @@
sSessionId, pService))
{
/* error : couldnot load web service */
- AXISTRACE1("SF_COULDNOTLOADSRV", CRITICAL);
- AXISC_THROW(SF_COULDNOTLOADSRV);
+ AXISTRACE1("SERVER_ENGINE_COULDNOTLOADSRV", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_COULDNOTLOADSRV);
//m_pSZ->
- // setSoapFault(SoapFault::getSoapFault(SF_COULDNOTLOADSRV));
+ // setSoapFault(SoapFault::getSoapFault(SERVER_ENGINE_COULDNOTLOADSRV));
break; // do .. while(0)
}
@@ -221,18 +220,18 @@
if (m_pSZ->getStyle () != nBindingStyle)
{
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
- AXISC_THROW(SF_SOAPCONTENTERROR);
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPCONTENTERROR);
//m_pSZ->
- // setSoapFault(SoapFault::getSoapFault(SF_SOAPCONTENTERROR));
+ // setSoapFault(SoapFault::getSoapFault(CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
}
else
{
- AXISTRACE1("SF_METHODNOTALLOWED", CRITICAL);
- AXISC_THROW(SF_METHODNOTALLOWED);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_METHODNOTALLOWED));
+ AXISTRACE1("CLIENT_WSDD_METHODNOTALLOWED", CRITICAL);
+ THROW_AXIS_WSDD_EXCEPTION(CLIENT_WSDD_METHODNOTALLOWED);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_WSDD_METHODNOTALLOWED));
// Method is not an exposed allowed method
break; // do .. while(0)
}
@@ -241,18 +240,18 @@
if (AXIS_SUCCESS != (Status = initializeHandlers (sSessionId,
pStream->getProtocol())))
{
- AXISTRACE1("SF_COULDNOTLOADHDL", CRITICAL);
- AXISC_THROW(SF_COULDNOTLOADHDL);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_COULDNOTLOADHDL));
+ AXISTRACE1("SERVER_ENGINE_COULDNOTLOADHDL", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_COULDNOTLOADHDL);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (SERVER_ENGINE_COULDNOTLOADHDL));
break; // do .. while(0)
}
// Get Service specific Handlers from the pool if configured any
if (AXIS_SUCCESS != (Status = g_pHandlerPool->getRequestFlowHandlerChain
(&m_pSReqFChain, sSessionId, pService)))
{
- AXISTRACE1("SF_COULDNOTLOADHDL", CRITICAL);
- AXISC_THROW(SF_COULDNOTLOADHDL);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_COULDNOTLOADHDL));
+ AXISTRACE1("SERVER_ENGINE_COULDNOTLOADHDL", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_COULDNOTLOADHDL);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (SERVER_ENGINE_COULDNOTLOADHDL));
break; // do .. while(0)
}
@@ -260,9 +259,9 @@
g_pHandlerPool->getResponseFlowHandlerChain (&m_pSResFChain,
sSessionId, pService)))
{
- AXISTRACE1("SF_COULDNOTLOADHDL", CRITICAL);
- AXISC_THROW(SF_COULDNOTLOADHDL);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_COULDNOTLOADHDL));
+ AXISTRACE1("SERVER_ENGINE_COULDNOTLOADHDL", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_COULDNOTLOADHDL);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (SERVER_ENGINE_COULDNOTLOADHDL));
break; // do .. while(0)
}
/*
@@ -275,9 +274,9 @@
*/
if (AXIS_SUCCESS != m_pDZ->getHeader ())
{
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
- AXISC_THROW(SF_SOAPCONTENTERROR);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPCONTENTERROR));
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
+ THROW_AXIS_SOAP_EXCEPTION(CLIENT_SOAP_SOAPCONTENTERROR);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
/*
@@ -289,7 +288,7 @@
if (AXIS_SUCCESS != m_pDZ->flushInputStream ())
{
- AXISTRACE1 ("SF_SOAPCONTENTERROR", CRITICAL);
+ AXISTRACE1 ("CLIENT_SOAP_SOAPCONTENTERROR", CRITICAL);
}
/*
* Get any header blocks unprocessed (left) in the Deserializer and add them
@@ -328,20 +327,23 @@
* the ServerAxisEngine from the webserver and report the error. You can
* also write this in a logfile specific to axis.
*/
- AXISC_CATCH(exception& e)
+ AXISC_CATCH(AxisException& e)
/*
* An exception which is not handled will be handled here.
*/
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_SOAPCONTENTERROR));
-#ifdef __ENABLE_AXIS_EXCEPTION__
- AxisException* objException = (AxisException*) &e;
- char* tempStr = (char*) objException->what();
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
+#ifdef ENABLE_AXIS_EXCEPTION
+ char* tempStr = (char*) e.what();
AXISTRACE2("Error:", tempStr, CRITICAL);
- return objException->getExceptionCode();
+ if(strcmp(tempStr, ""))
+ return AXIS_SUCCESS;
+ else
+ return e.getExceptionCode();
#endif
+ AXISC_CATCH(exception& e)
AXISC_CATCH(...)
-#ifdef __ENABLE_AXIS_EXCEPTION__
- return AXISC_UNKNOWN_ERROR;
+#ifdef ENABLE_AXIS_EXCEPTION
+ return SERVER_UNKNOWN_ERROR;
#endif
AXISC_ENDCATCH
return AXIS_SUCCESS;
@@ -360,9 +362,9 @@
{
if (AXIS_SUCCESS != (Status = m_pTReqFChain->invoke (pMsg)))
{
- AXISTRACE1("SF_HANDLERFAILED", CRITICAL);
- AXISC_THROW(SF_HANDLERFAILED);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault(SF_HANDLERFAILED));
+ AXISTRACE1("SERVER_ENGINE_HANDLERFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERFAILED);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault(SERVER_ENGINE_HANDLERFAILED));
break; // do .. while (0)
}
@@ -373,9 +375,9 @@
{
if (AXIS_SUCCESS != (Status = m_pGReqFChain->invoke (pMsg)))
{
- AXISTRACE1("SF_HANDLERFAILED", CRITICAL);
- AXISC_THROW(SF_HANDLERFAILED);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault(SF_HANDLERFAILED));
+ AXISTRACE1("SERVER_ENGINE_HANDLERFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERFAILED);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault(SERVER_ENGINE_HANDLERFAILED));
break; // do .. while (0)
}
}
@@ -385,9 +387,9 @@
{
if (AXIS_SUCCESS != (Status = m_pSReqFChain->invoke (pMsg)))
{
- AXISTRACE1("SF_HANDLERFAILED", CRITICAL);
- AXISC_THROW(SF_HANDLERFAILED);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault(SF_HANDLERFAILED));
+ AXISTRACE1("SERVER_ENGINE_HANDLERFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_HANDLERFAILED);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault(SERVER_ENGINE_HANDLERFAILED));
break; // do .. while (0)
}
}
@@ -399,9 +401,9 @@
*/
if (m_pDZ->isAnyMustUnderstandHeadersLeft ())
{
- AXISTRACE1("SF_MUST_UNDERSTAND", CRITICAL);
- AXISC_THROW(SF_MUST_UNDERSTAND);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (SF_MUST_UNDERSTAND));
+ AXISTRACE1("SOAP_MUSTUNDERSTAND", CRITICAL);
+ THROW_AXIS_EXCEPTION(SOAP_MUSTUNDERSTAND);
+ //m_pSZ->setSoapFault (SoapFault::getSoapFault (SOAP_MUSTUNDERSTAND));
break; // do .. while (0)
}
// Call actual web service handler
@@ -425,10 +427,10 @@
Status = AXIS_FAIL;
if (AXIS_SUCCESS != Status)
{
- AXISTRACE1("SF_WEBSERVICEFAILED", CRITICAL);
- AXISC_THROW(SF_WEBSERVICEFAILED);
+ AXISTRACE1("SERVER_ENGINE_WEBSERVICEFAILED", CRITICAL);
+ THROW_AXIS_ENGINE_EXCEPTION(SERVER_ENGINE_WEBSERVICEFAILED);
//m_pSZ->
- // setSoapFault(SoapFault::getSoapFault(SF_WEBSERVICEFAILED));
+ // setSoapFault(SoapFault::getSoapFault(SERVER_ENGINE_WEBSERVICEFAILED));
break;
}
}
1.6 +4 -0 ws-axis/c/src/engine/server/ServerAxisEngine.h
Index: ServerAxisEngine.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/server/ServerAxisEngine.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ServerAxisEngine.h 12 May 2004 07:36:46 -0000 1.5
+++ ServerAxisEngine.h 18 May 2004 04:32:31 -0000 1.6
@@ -19,6 +19,10 @@
#define AXIS_SERVERAXISENGINE_H__OF_AXIS_INCLUDED_
#include <axis/server/AxisEngine.h>
+#include "../AxisEngineException.h"
+#include "../../soap/AxisSoapException.h"
+#include "../../wsdd/AxisWsddException.h"
+#include "../../common/AxisConfigException.h"
/*
* @class ServerAxisEngine
* @brief interface for the ServerAxisEngine class.
1.2 +59 -3 ws-axis/c/src/soap/AxisSoapException.cpp
Index: AxisSoapException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/AxisSoapException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AxisSoapException.cpp 13 May 2004 12:18:31 -0000 1.1
+++ AxisSoapException.cpp 18 May 2004 04:32:31 -0000 1.2
@@ -19,17 +19,17 @@
*
*/
-#include <axis/server/AxisSoapException.h>
+#include "AxisSoapException.h"
#include <exception>
using namespace std;
/**
* Default when no parameter passed. When thrown with no parameter
- * more general AXISC_SOAP_EXCEPTION is assumed.
+ * more general SERVER_SOAP_EXCEPTION is assumed.
*/
AxisSoapException::AxisSoapException()
{
- processException(AXISC_SOAP_EXCEPTION);
+ processException(SERVER_SOAP_EXCEPTION);
}
AxisSoapException::AxisSoapException (int iExceptionCode)
@@ -51,5 +51,61 @@
AxisSoapException::~AxisSoapException() throw ()
{
+}
+
+void AxisSoapException::processException (exception* e, int iExceptionCode)
+{
+ m_sMessage = getMessage (e) + getMessage (iExceptionCode);
+}
+
+void AxisSoapException::processException (exception* e)
+{
+ m_sMessage = getMessage (e);
+}
+
+void AxisSoapException::processException(int iExceptionCode)
+{
+ m_sMessage = getMessage (iExceptionCode);
+}
+
+const string AxisSoapException::getMessage (exception* objException)
+{
+ string sMessage = objException->what();
+
+ return sMessage;
+}
+
+const string AxisSoapException::getMessage (int iExceptionCode)
+{
+ string sMessage;
+ switch(iExceptionCode)
+ {
+
+ case CLIENT_SOAP_MESSAGEINCOMPLETE:
+ sMessage = "Received message is incomplete";
+ break;
+ case CLIENT_SOAP_SOAPACTIONEMTPY:
+ sMessage = "Soap action is empty";
+ break;
+ case CLIENT_SOAP_SOAPCONTENTERROR:
+ sMessage = "Received content is faulty";
+ break;
+ case CLIENT_SOAP_NOSOAPMETHOD:
+ sMessage = "Request method is not a soap method";
+ break;
+ default:
+ sMessage = "Unknown Soap Exception";
+ }
+ return sMessage;
+}
+
+const char* AxisSoapException::what() throw ()
+{
+ return m_sMessage.c_str ();
+}
+
+const int AxisSoapException::getExceptionCode()
+{
+ return m_iExceptionCode;
}
1.8 +2 -1 ws-axis/c/src/soap/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.am 5 Apr 2004 13:51:09 -0000 1.7
+++ Makefile.am 18 May 2004 04:32:31 -0000 1.8
@@ -17,7 +17,8 @@
SoapKeywordMapping.cpp \
SoapParserExpat.cpp \
apr_base64.c \
- HexCoder.cpp
+ HexCoder.cpp \
+ AxisSoapException.cpp
libsoap_la_LIBADD = $(LDFLAGS)
INCLUDES = -I$(AXISCPP_HOME)/include
1.2 +9 -20 ws-axis/c/src/soap/Makefile.am_expat
Index: Makefile.am_expat
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/Makefile.am_expat,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.am_expat 8 Apr 2004 03:25:10 -0000 1.1
+++ Makefile.am_expat 18 May 2004 04:32:31 -0000 1.2
@@ -1,23 +1,12 @@
-noinst_LTLIBRARIES = libsoap.la
-
+noinst_LTLIBRARIES = libwsdd.la
AM_CPPFLAGS = $(CPPFLAGS)
-libsoap_la_SOURCES = Attribute.cpp \
- BasicNode.cpp \
- CharacterElement.cpp \
- ComplexElement.cpp \
- HeaderBlock.cpp \
- SoapBody.cpp \
- SoapDeSerializer.cpp \
- SoapEnvelope.cpp \
- SoapFault.cpp \
- SoapHeader.cpp \
- SoapMethod.cpp \
- SoapSerializer.cpp \
- URIMapping.cpp \
- SoapKeywordMapping.cpp \
- SoapParserExpat.cpp \
- apr_base64.c \
- HexCoder.cpp
+libwsdd_la_SOURCES = WSDDDeployment.cpp \
+ WSDDHandler.cpp \
+ WSDDService.cpp \
+ WSDDTransport.cpp \
+ WSDDKeywords.cpp \
+ WSDDDocumentExpat.cpp \
+ AxisWsddException.cpp
-libsoap_la_LIBADD = $(LDFLAGS)
+libwsdd_la_LIBADD = $(LDFLAGS)
INCLUDES = -I$(AXISCPP_HOME)/include
1.2 +9 -23 ws-axis/c/src/soap/Makefile.am_xercesc
Index: Makefile.am_xercesc
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/Makefile.am_xercesc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.am_xercesc 8 Apr 2004 03:25:10 -0000 1.1
+++ Makefile.am_xercesc 18 May 2004 04:32:31 -0000 1.2
@@ -1,26 +1,12 @@
-noinst_LTLIBRARIES = libsoap.la
-
+noinst_LTLIBRARIES = libwsdd.la
AM_CPPFLAGS = $(CPPFLAGS)
-libsoap_la_SOURCES = Attribute.cpp \
- BasicNode.cpp \
- CharacterElement.cpp \
- ComplexElement.cpp \
- HeaderBlock.cpp \
- SoapBody.cpp \
- SoapDeSerializer.cpp \
- SoapEnvelope.cpp \
- SoapFault.cpp \
- SoapHeader.cpp \
- SoapMethod.cpp \
- SoapSerializer.cpp \
- URIMapping.cpp \
- SoapKeywordMapping.cpp \
- apr_base64.c \
- HexCoder.cpp \
- SoapBinInputStream.cpp \
- SoapInputSource.cpp \
- SoapParserXerces.cpp \
- XercesHandler.cpp
+libwsdd_la_SOURCES = WSDDDeployment.cpp \
+ WSDDHandler.cpp \
+ WSDDService.cpp \
+ WSDDTransport.cpp \
+ WSDDKeywords.cpp \
+ WSDDDocumentXerces.cpp \
+ AxisWsddException.cpp
-libsoap_la_LIBADD = $(LDFLAGS)
+libwsdd_la_LIBADD = $(LDFLAGS)
INCLUDES = -I$(AXISCPP_HOME)/include
1.19 +3 -3 ws-axis/c/src/soap/SoapBody.cpp
Index: SoapBody.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapBody.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SoapBody.cpp 26 Apr 2004 04:04:37 -0000 1.18
+++ SoapBody.cpp 18 May 2004 04:32:31 -0000 1.19
@@ -58,9 +58,9 @@
m_pSoapMethod= ptrSoapMethod;
}
-void SoapBody::setSoapFault(SoapFault *ptrSoapFault)
+void SoapBody::setSoapFault(SoapFault *pSoapFault)
{
- m_pSoapFault= ptrSoapFault;
+ m_pSoapFault= pSoapFault;
}
int SoapBody::serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
@@ -98,7 +98,7 @@
}
else
{
- m_pSoapFault = SoapFault::getSoapFault(SF_WEBSERVICEFAILED);
+ m_pSoapFault = SoapFault::getSoapFault(SERVER_ENGINE_WEBSERVICEFAILED);
if(m_pSoapFault!=NULL)
{
iStatus= m_pSoapFault->serialize(pSZ);
1.12 +2 -2 ws-axis/c/src/soap/SoapBody.h
Index: SoapBody.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapBody.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SoapBody.h 26 Apr 2004 04:04:37 -0000 1.11
+++ SoapBody.h 18 May 2004 04:32:31 -0000 1.12
@@ -18,7 +18,7 @@
#define AXIS_SOAPBODY_H__OF_AXIS_INCLUDED_
#include "SoapMethod.h"
-#include <axis/server/SoapFault.h>
+#include "SoapFault.h"
#include <axis/server/SoapEnvVersions.h>
class Attribute;
@@ -77,7 +77,7 @@
/* string& serialize(); */
int serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion);
/* int serialize(string&, SOAP_VERSION eSoapVersion); */
- void setSoapFault(SoapFault* ptrSoapFault);
+ void setSoapFault(SoapFault* pSoapFault);
void setSoapMethod(SoapMethod* ptrSoapMethod);
SoapBody();
virtual ~SoapBody();
1.45 +5 -7 ws-axis/c/src/soap/SoapDeSerializer.cpp
Index: SoapDeSerializer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- SoapDeSerializer.cpp 12 May 2004 07:36:47 -0000 1.44
+++ SoapDeSerializer.cpp 18 May 2004 04:32:31 -0000 1.45
@@ -29,7 +29,7 @@
#include <axis/server/SoapHeader.h>
#include "SoapMethod.h"
#include "SoapBody.h"
-#include <axis/server/SoapFault.h>
+#include "SoapFault.h"
#include "ComplexElement.h"
#include <axis/server/CharacterElement.h>
#include <axis/server/GDefine.h>
@@ -276,25 +276,21 @@
int SoapDeSerializer::getBody()
{
- AXISTRACE1("came1", INFO);
if (!m_pNode) m_pNode = m_pParser->next();
AXISTRACE1("came2", INFO);
/* previous header searching may have left a node unidentified */
if (m_pNode)
{
- AXISTRACE1("came3", INFO);
if ((START_ELEMENT == m_pNode->m_type) &&
(0 == strcmp(m_pNode->m_pchNameOrValue,
SoapKeywordMapping::map(m_nSoapVersion).pchWords[SKW_BODY])))
{
- AXISTRACE1("came4", INFO);
/* Set any attributes/namspaces to the SoapBody object */
m_pNode = NULL; /* This is to indicate that node is identified
* and used */
return AXIS_SUCCESS;
}
}
- AXISTRACE1("came5", INFO);
m_nStatus = AXIS_FAIL;
return AXIS_FAIL;
}
@@ -315,10 +311,12 @@
if(0 != strcmp(m_pNode->m_pchNameOrValue, "Fault"))
{
m_nStatus = AXIS_FAIL;
- return AXIS_FAIL;
+ THROW_AXIS_EXCEPTION(AXISC_UNKNOWN_ELEMENT_EXCEPTION);
}
else//Body contains soap fault
- iResult = getFault();
+ //iResult = getFault();
+ THROW_AXIS_EXCEPTION(AXISC_SOAP_FAULT_EXCEPTION);
+
}
/* we can check the namespace uri too here. Should we ?*/
1.19 +66 -66 ws-axis/c/src/soap/SoapFault.cpp
Index: SoapFault.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapFault.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SoapFault.cpp 12 May 2004 04:57:54 -0000 1.18
+++ SoapFault.cpp 18 May 2004 04:32:31 -0000 1.19
@@ -18,7 +18,7 @@
* @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
*/
-#include <axis/server/SoapFault.h>
+#include "SoapFault.h"
#include <axis/server/SoapSerializer.h>
#include <axis/server/SoapEnvVersions.h>
#include <axis/server/GDefine.h>
@@ -37,34 +37,6 @@
}
-/*int SoapFault::setFaultcode(const string& sFaultcode)
-{
- m_sFaultcode= sFaultcode;
-
- return AXIS_SUCCESS;
-}*/
-
-/*int SoapFault::setFaultstring(const string& sFaultstring)
-{
- m_sFaultstring= sFaultstring;
-
- return AXIS_SUCCESS;
-}*/
-
-/*int SoapFault::setFaultactor(const string& sFaultactor)
-{
- m_sFaultactor= sFaultactor;
-
- return AXIS_SUCCESS;
-}*/
-
-/*int SoapFault::setDetail(const string& sDetail)
-{
- m_sDetail= sDetail;
-
- return AXIS_SUCCESS;
-}*/
-
int SoapFault::serialize(SoapSerializer& pSZ)
{
/* written according to SOAP Version 1.1 */
@@ -84,37 +56,17 @@
{
pSZ.serialize("<detail>", m_sFaultDetail.c_str(), "</detail>", NULL);
}
+
+ if(m_pFaultDetail)
+ {
+ pSZ.serialize("<detail>", m_pFaultDetail->serialize(pSZ), "</detail>", NULL);
+ }
pSZ.serialize("</SOAP-ENV:Fault>", NULL);
return iStatus;
}
-/*
-comm on 11/7/2003 at 9.30am
-int SoapFault::serialize(string& sSerialized)
-{
- // written according to SOAP Version 1.1
-
- int iStatus= AXIS_SUCCESS;
-
- sSerialized= sSerialized+ "<SOAP-ENV:Fault>" + "\n";
- sSerialized= sSerialized+ "<faultcode>"+ m_sFaultcode+ "</faultcode>"+ "\n";
- sSerialized= sSerialized+ "<faultstring>"+m_sFaultstring+"</faultstring>"+ "\n";
-
- if(!m_sFaultactor.empty()) {
- sSerialized= sSerialized+ "<faultactor>"+ m_sFaultactor +"</faultactor>"+ "\n";
- }
-
- if(!m_sDetail.empty()) {
- sSerialized= sSerialized+ "<detail>"+ m_sDetail +"</detail>"+ "\n";
- }
-
- sSerialized= sSerialized+ "</SOAP-ENV:Fault>" + "\n";
-
- return iStatus;
-}
-*/
void SoapFault::initialize()
{
@@ -129,41 +81,45 @@
/*Client faults */
{"Client", "Soap message is incorrect or incomplete", "", ""},
{"Client", "Soap Action header empty", "", ""},
- {"Client", "Requested service is not registerd at the server", "", ""},
{"Client", "Soap content is not valid", "", ""},
{"Client", "No method to invoke", "", ""},
+ {"Client", "Requested service is not registerd at the server", "", ""},
{"Client", "Soap method is not allowed to invoke", "", ""},
{"Client", "Parameter type mismatch", "", ""},
{"Client", "A client handler failed", "", ""},
/*Server faults */
+ {"Server", "Unknown Engine Exception", "", ""},
{"Server", "Cannot load web service", "", ""},
{"Server", "Cannot load service handlers", "", ""},
{"Server", "A service handler failed", "", ""},
{"Server", "Webservice failed", "", ""},
- {"Server", "Transport configuration error", "", ""},
{"Server", "Handler initialization failed", "", ""},
{"Server", "Handler creation failed", "", ""},
{"Server", "Library loading failed", "", ""},
- {"Server", "Library path is empty", "", ""},
{"Server", "Handler not loaded", "", ""},
{"Server", "Handler is being used", "", ""},
{"Server", "Get hander failed", "", ""},
{"Server", "Wrong handler type", "", ""},
+ {"Server", "Unknown Axis Configuration Exception", "", ""},
+ {"Server", "Transport configuration error", "", ""},
+ {"Server", "Library path is empty", "", ""},
+ {"Server", "Unknown Wsdd Exception", "", ""},
{"Server", "No handlers configured", "", ""},
- {"Server", "Unknown error", "", ""}
+ {"Server", "Unknown Soap Exception", "", ""},
+ {"Server", "Unknown Transport Exception", "", ""},
+ {"Server", "Receive from transport failed", "", ""},
+ {"Server", "Send to transport failed", "", ""},
+ {"Server", "Http transport exception", "", ""},
+ {"Server", "Test exception", "", ""},
+ {"Server", "Unknown exception", "", ""}
+
};
s_parrSoapFaultStruct = s_arrLocalFaultStruct;
m_bInit = true;
}
}
-
-const char* SoapFault::getSoapString()
-{
- return m_sFaultstring.c_str();
-}
-
/*the caller of the SoapFault::getSoapFault(int) has to delete the
* returned SoapFault pointer
*/
@@ -196,14 +152,58 @@
m_sFaultDetail= sDetail;
}
-void SoapFault::setFaultactor(const string& sFaultactor)
+int SoapFault::setFaultcode(const string& sFaultcode)
+{
+ m_sFaultcode= sFaultcode;
+
+ return AXIS_SUCCESS;
+}
+
+int SoapFault::setFaultstring(const string& sFaultstring)
+{
+ m_sFaultstring= sFaultstring;
+
+ return AXIS_SUCCESS;
+}
+int SoapFault::setFaultactor(const string& sFaultactor)
{
m_sFaultactor = sFaultactor;
+
+ return AXIS_SUCCESS;
}
-void SoapFault::setFaultDetail(const string& sFaultDetail)
+int SoapFault::setFaultDetail(const string& sFaultDetail)
{
m_sFaultDetail = sFaultDetail;
+
+ return AXIS_SUCCESS;
+}
+
+int SoapFault::setFaultDetail(const Param* pFaultDetail)
+{
+ m_pFaultDetail = (Param*) pFaultDetail;
+
+ return AXIS_SUCCESS;
+}
+
+void SoapFault::setPrefix(const AxisChar* prefix)
+{
+ m_strPrefix = prefix;
+}
+
+void SoapFault::setLocalName(const AxisChar* localname)
+{
+ m_strLocalname = localname;
+}
+
+void SoapFault::setUri(const AxisChar* uri)
+{
+ m_strUri = uri;
+}
+
+const char* SoapFault::getSoapString()
+{
+ return m_sFaultstring.c_str();
}
string SoapFault::getFaultcode()
1.46 +29 -0 ws-axis/c/src/soap/SoapSerializer.cpp
Index: SoapSerializer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- SoapSerializer.cpp 12 May 2004 07:36:47 -0000 1.45
+++ SoapSerializer.cpp 18 May 2004 04:32:31 -0000 1.46
@@ -202,6 +202,24 @@
return AXIS_SUCCESS;
}
+int SoapSerializer::addFaultDetail(void* pObject, void* pSZFunct,
+ void* pDelFunct, const AxisChar* pName,
+ const AxisChar* pNamespace )
+{
+ Param* pParam = new Param();
+ pParam->m_Value.pCplxObj = new ComplexObjectHandler;
+ pParam->m_Value.pCplxObj->pObject = pObject;
+ pParam->m_Value.pCplxObj->pSZFunct = (AXIS_SERIALIZE_FUNCT)pSZFunct;
+ pParam->m_Value.pCplxObj->pDelFunct = (AXIS_OBJECT_DELETE_FUNCT)pDelFunct;
+ if(m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody) && (m_pSoapEnvelope->
+ m_pSoapBody->m_pSoapFault))
+ {
+ m_pSoapEnvelope->m_pSoapBody->m_pSoapFault->setFaultDetail(pParam);
+ }
+ pParam->setName(pName);
+ return AXIS_SUCCESS;
+}
+
int SoapSerializer::setSoapFault(SoapFault *pSoapFault)
{
int intStatus= AXIS_FAIL;
@@ -421,6 +439,17 @@
pMethod->setLocalName(sLocalName);
pMethod->setPrefix(getNamespacePrefix(sURI));
pMethod->setUri(sURI);
+ return AXIS_SUCCESS;
+}
+
+int SoapSerializer::createSoapFault(const AxisChar* sLocalName,
+ const AxisChar* sURI)
+{
+ SoapFault* pFault = new SoapFault();
+ setSoapFault(pFault);
+ pFault->setLocalName(sLocalName);
+ pFault->setPrefix(getNamespacePrefix(sURI));
+ pFault->setUri(sURI);
return AXIS_SUCCESS;
}
1.1 ws-axis/c/src/soap/SoapFault.h
Index: SoapFault.h
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef WIN32
#pragma warning (disable : 4786)
#endif
#if !defined(_SOAPFAULT_H____OF_AXIS_INCLUDED_)
#define _SOAPFAULT_H____OF_AXIS_INCLUDED_
#include <string>
#include <map>
#include <axis/server/AxisException.h>
#include <axis/server/Param.h>
class SoapSerializer;
using namespace std;
/**
* The structure which is used as a container for soap faults.
*/
typedef struct
{
const char* pcFaultcode;
const char* pcFaultstring;
const char* pcFaultactor;
const char* pcFaultDetail;
} SoapFaultStruct;
/*
* This array of structure is used to store all the soap faults
* which are used in Axis C++. Each time a fault object is needed it is
* created using this array, in SoapFault class.
*/
static SoapFaultStruct* s_parrSoapFaultStruct;
/**
* @class SoapFault
* @brief interface for the SoapFault class.
*
*
* @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
* @author damitha kumarage (damitha@jkcsworld.com, damitha@opensource.lk)
*/
class SoapFault
{
friend class SoapFaultsTestCase;
public:
SoapFault();
SoapFault(string m_sFaultcode, string m_sFaultstring,
string m_sFaultactor, string m_sDetail);
bool operator ==(const SoapFault &objSoapFault);
static SoapFault* getSoapFault(int);
static void initialize();
const char* getSoapString();
int serialize(SoapSerializer& pSZ);
/* int serialize(string&); */
virtual ~SoapFault();
int setFaultDetail(const string& sDetail);
int setFaultDetail(const Param* pFaultDetail);
int setFaultactor(const string& sFaultactor);
int setFaultstring(const string& sFaultstring);
int setFaultcode(const string& sFaultcode);
string getFaultcode();
string getFaultstring();
string getFaultactor();
string getFaultDetail();
void setUri(const AxisChar* uri);
void setLocalName(const AxisChar* localname);
void setPrefix(const AxisChar* prefix);
private:
/* string m_sFaultSerialized; */
string m_sFaultDetail;
string m_sFaultactor;
string m_sFaultstring;
string m_sFaultcode;
Param* m_pFaultDetail;
AxisString m_strPrefix;
AxisString m_strLocalname;
AxisString m_strUri;
static volatile bool m_bInit;
};
#endif
1.26 +1 -1 ws-axis/c/src/transport/axis/HttpTransport.cpp
Index: HttpTransport.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis/HttpTransport.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- HttpTransport.cpp 6 May 2004 03:55:19 -0000 1.25
+++ HttpTransport.cpp 18 May 2004 04:32:31 -0000 1.26
@@ -390,7 +390,7 @@
if (!m_bStatus)
{
Error(m_sHeader.c_str());
- throw AxisException(AXISC_HTTP_ERROR);
+ throw AxisException(SERVER_TRANSPORT_HTTP_EXCEPTION);
}
}
}
1.11 +9 -3 ws-axis/c/src/transport/axis/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Makefile.am 14 May 2004 08:30:19 -0000 1.10
+++ Makefile.am 18 May 2004 04:32:31 -0000 1.11
@@ -1,8 +1,14 @@
lib_LTLIBRARIES = libaxis_transport.la
AM_CPPFLAGS = $(CPPFLAGS)
-libaxis_transport_la_SOURCES = Channel.cpp HttpTransport.cpp Receiver.cpp Sender.cpp \
- Transport.cpp TransportFactory.cpp Url.cpp AxisTransport.cpp
+libaxis_transport_la_SOURCES = Channel.cpp \
+ HttpTransport.cpp \
+ Receiver.cpp Sender.cpp \
+ Transport.cpp \
+ TransportFactory.cpp \
+ Url.cpp \
+ AxisTransport.cpp \
+ AxisTransportException.cpp
-libtransport_la_LIBADD = -lstdc++
+libaxis_transport_la_LIBADD = -lstdc++
INCLUDES = -I$(AXISCPP_HOME)/include
1.17 +1 -1 ws-axis/c/src/transport/axis/Receiver.cpp
Index: Receiver.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis/Receiver.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Receiver.cpp 6 May 2004 03:55:19 -0000 1.16
+++ Receiver.cpp 18 May 2004 04:32:31 -0000 1.17
@@ -71,7 +71,7 @@
catch(...)
{
printf("catch(...)\n");
- throw AxisException(AXISC_RECEPTION_ERROR);
+ throw AxisException(SERVER_TRANSPORT_RECEPTIONEXCEPTION);
}
}
/* printf("m_MsgSize:%d\n", m_MsgSize); */
1.11 +1 -1 ws-axis/c/src/transport/axis/Sender.cpp
Index: Sender.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis/Sender.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Sender.cpp 6 May 2004 03:55:19 -0000 1.10
+++ Sender.cpp 18 May 2004 04:32:31 -0000 1.11
@@ -49,7 +49,7 @@
}
catch(...)
{
- throw AxisException(AXISC_SENDING_ERROR);
+ throw AxisException(SERVER_TRANSPORT_SENDINGEXCEPTION);
}
return true;
1.2 +58 -3 ws-axis/c/src/wsdd/AxisWsddException.cpp
Index: AxisWsddException.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdd/AxisWsddException.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AxisWsddException.cpp 13 May 2004 12:18:31 -0000 1.1
+++ AxisWsddException.cpp 18 May 2004 04:32:32 -0000 1.2
@@ -19,17 +19,17 @@
*
*/
-#include <axis/server/AxisWsddException.h>
+#include "AxisWsddException.h"
#include <exception>
using namespace std;
/**
* Default when no parameter passed. When thrown with no parameter
- * more general AXISC_WSDD_EXCEPTION is assumed.
+ * more general SERVER_WSDD_EXCEPTION is assumed.
*/
AxisWsddException::AxisWsddException()
{
- processException(AXISC_WSDD_EXCEPTION);
+ processException(SERVER_WSDD_EXCEPTION);
}
AxisWsddException::AxisWsddException (int iExceptionCode)
@@ -51,5 +51,60 @@
AxisWsddException::~AxisWsddException() throw ()
{
+}
+
+void AxisWsddException::processException (exception* e, int iExceptionCode)
+{
+ m_sMessage = getMessage (e) + getMessage (iExceptionCode);
+}
+
+void AxisWsddException::processException (exception* e)
+{
+ m_sMessage = getMessage (e);
+}
+
+void AxisWsddException::processException(int iExceptionCode)
+{
+ m_sMessage = getMessage (iExceptionCode);
+}
+
+const string AxisWsddException::getMessage (exception* objException)
+{
+ string sMessage = objException->what();
+
+ return sMessage;
+}
+
+const string AxisWsddException::getMessage (int iExceptionCode)
+{
+ string sMessage;
+ switch(iExceptionCode)
+ {
+ case CLIENT_WSDD_SERVICENOTFOUND:
+ sMessage = "Requested service not found";
+ break;
+ case CLIENT_WSDD_METHODNOTALLOWED:
+ sMessage = "Requested method is not allowed";
+ break;
+ case CLIENT_WSDD_PARATYPEMISMATCH:
+ sMessage = "Parameter type mismatch";
+ break;
+ case SERVER_WSDD_NOHANDLERSCONFIGURED:
+ sMessage = "No handlers configured in server.wsdd";
+ break;
+ default:
+ sMessage = "Unknown Wsdd Exception";
+ }
+ return sMessage;
+}
+
+const char* AxisWsddException::what() throw ()
+{
+ return m_sMessage.c_str ();
+}
+
+const int AxisWsddException::getExceptionCode()
+{
+ return m_iExceptionCode;
}
1.10 +2 -1 ws-axis/c/src/wsdd/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdd/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Makefile.am 6 May 2004 03:55:19 -0000 1.9
+++ Makefile.am 18 May 2004 04:32:32 -0000 1.10
@@ -5,7 +5,8 @@
WSDDService.cpp \
WSDDTransport.cpp \
WSDDKeywords.cpp \
- WSDDDocumentExpat.cpp
+ WSDDDocumentExpat.cpp \
+ AxisWsddException.cpp
libwsdd_la_LIBADD = $(LDFLAGS)
INCLUDES = -I$(AXISCPP_HOME)/include