You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/05/12 06:57:54 UTC
cvs commit: ws-axis/c/src/soap SoapFault.cpp
damitha 2004/05/11 21:57:54
Modified: c/include/axis/server AxisFile.h SoapFault.h
c/src/engine/server ServerAxisEngine.cpp
c/src/soap SoapFault.cpp
Log:
Revision Changes Path
1.2 +2 -0 ws-axis/c/include/axis/server/AxisFile.h
Index: AxisFile.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisFile.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AxisFile.h 6 May 2004 03:55:18 -0000 1.1
+++ AxisFile.h 12 May 2004 04:57:54 -0000 1.2
@@ -84,6 +84,7 @@
int filePuts (const char* pcWrite)
{
fputs(pcWrite, pFILEFile);
+ return AXIS_SUCCESS;
}
/** Use this flush the buffer
@@ -91,6 +92,7 @@
int fileFlush ()
{
fflush(pFILEFile);
+ return AXIS_SUCCESS;
}
~AxisFile()
1.16 +3 -3 ws-axis/c/include/axis/server/SoapFault.h
Index: SoapFault.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapFault.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SoapFault.h 7 May 2004 08:32:13 -0000 1.15
+++ SoapFault.h 12 May 2004 04:57:54 -0000 1.16
@@ -45,7 +45,7 @@
* 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_arrSoapFaultStruct[FAULT_LAST];
+static SoapFaultStruct* s_parrSoapFaultStruct;
/**
* @class SoapFault
@@ -53,6 +53,7 @@
*
*
* @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
+ * @author damitha kumarage (damitha@jkcsworld.com, damitha@opensource.lk)
*/
class SoapFault
{
@@ -60,7 +61,7 @@
public:
SoapFault(string m_sFaultcode, string m_sFaultstring,
- string m_sFaultactor, string m_sDetail);
+ string m_sFaultactor, string m_sDetail);
bool operator ==(const SoapFault &objSoapFault);
static SoapFault* getSoapFault(int);
static void initialize();
@@ -86,7 +87,6 @@
string m_sFaultactor;
string m_sFaultstring;
string m_sFaultcode;
- static map<int, SoapFaultStruct> m_sFaultMap;
static volatile bool m_bInit;
};
1.9 +2 -0 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ServerAxisEngine.cpp 6 May 2004 03:55:19 -0000 1.8
+++ ServerAxisEngine.cpp 12 May 2004 04:57:54 -0000 1.9
@@ -490,4 +490,6 @@
objSoapFault->setFaultDetail(sMessage);
m_pSZ->setSoapFault (objSoapFault);
m_pSZ->setOutputStream (stream);
+
+ return AXIS_SUCCESS;
}
1.18 +41 -63 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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SoapFault.cpp 6 May 2004 03:55:19 -0000 1.17
+++ SoapFault.cpp 12 May 2004 04:57:54 -0000 1.18
@@ -25,7 +25,6 @@
#include <axis/server/AxisTrace.h>
extern AxisTrace* g_pAT;
-map<int, SoapFaultStruct> SoapFault::m_sFaultMap;
volatile bool SoapFault::m_bInit = false;
SoapFault::SoapFault()
@@ -121,66 +120,45 @@
{
if (!m_bInit)
{
- /*VersionMismatch faults */
- s_arrSoapFaultStruct[SF_VERSION_MISMATCH] = (SoapFaultStruct)
- {"VersionMismatch", "Soap Version Mismatch error", "", ""};
- /*MustUnderstand faults */
- s_arrSoapFaultStruct[SF_MUST_UNDERSTAND] = (SoapFaultStruct)
- {"MustUnderstand", "Soap Must Understand error", "", ""};
- /*Client faults */
- s_arrSoapFaultStruct[SF_MESSAGEINCOMPLETE] = (SoapFaultStruct)
- {"Client", "Soap message is incorrect or incomplete", "", ""};
- s_arrSoapFaultStruct[SF_SOAPACTIONEMPTY] = (SoapFaultStruct)
- {"Client", "Soap Action header empty", "", ""};
- s_arrSoapFaultStruct[SF_SERVICENOTFOUND] = (SoapFaultStruct)
- {"Client", "Requested service is not registerd at the server", "", ""};
- s_arrSoapFaultStruct[SF_SOAPCONTENTERROR] = (SoapFaultStruct)
- {"Client", "Soap content is not valid", "", ""};
- s_arrSoapFaultStruct[SF_NOSOAPMETHOD] = (SoapFaultStruct)
- {"Client", "No method to invoke", "", ""};
- s_arrSoapFaultStruct[SF_METHODNOTALLOWED] = (SoapFaultStruct)
- {"Client", "Soap method is not allowed to invoke", "", ""};
- s_arrSoapFaultStruct[SF_PARATYPEMISMATCH] = (SoapFaultStruct)
- {"Client", "Parameter type mismatch", "", ""};
- s_arrSoapFaultStruct[SF_CLIENTHANDLERFAILED] = (SoapFaultStruct)
- {"Client", "A client handler failed", "", ""};
-
- /*Server faults */
- s_arrSoapFaultStruct[SF_COULDNOTLOADSRV] = (SoapFaultStruct)
- {"Server", "Cannot load web service", "", ""};
- s_arrSoapFaultStruct[SF_COULDNOTLOADHDL] = (SoapFaultStruct)
- {"Server", "Cannot load service handlers", "", ""};
- s_arrSoapFaultStruct[SF_HANDLERFAILED] = (SoapFaultStruct)
- {"Server", "A service handler failed", "", ""};
- s_arrSoapFaultStruct[SF_WEBSERVICEFAILED] = (SoapFaultStruct)
- {"Server", "Webservice failed", "", ""};
- s_arrSoapFaultStruct[AXISC_TRANSPORT_CONF_ERROR] = (SoapFaultStruct)
- {"Server", "Transport configuration error", "", ""};
- s_arrSoapFaultStruct[HANDLER_INIT_FAIL] = (SoapFaultStruct)
- {"Server", "Handler initialization failed", "", ""};
- s_arrSoapFaultStruct[HANDLER_CREATION_FAILED] = (SoapFaultStruct)
- {"Server", "Handler creation failed", "", ""};
- s_arrSoapFaultStruct[LOADLIBRARY_FAILED] = (SoapFaultStruct)
- {"Server", "Library loading failed", "", ""};
- s_arrSoapFaultStruct[LIBRARY_PATH_EMPTY] = (SoapFaultStruct)
- {"Server", "Library path is empty", "", ""};
- s_arrSoapFaultStruct[HANDLER_NOT_LOADED] = (SoapFaultStruct)
- {"Server", "Handler not loaded", "", ""};
- s_arrSoapFaultStruct[HANDLER_BEING_USED] = (SoapFaultStruct)
- {"Server", "Handler is being used", "", ""};
- s_arrSoapFaultStruct[GET_HANDLER_FAILED] = (SoapFaultStruct)
- {"Server", "Get hander failed", "", ""};
- s_arrSoapFaultStruct[WRONG_HANDLER_TYPE] = (SoapFaultStruct)
- {"Server", "Wrong handler type", "", ""};
- s_arrSoapFaultStruct[NO_HANDLERS_CONFIGURED] = (SoapFaultStruct)
- {"Server", "No handlers configured", "", ""};
- s_arrSoapFaultStruct[AXISC_UNKNOWN_ERROR] = (SoapFaultStruct)
- {"Server", "Unknown error", "", ""};
-
+ static SoapFaultStruct s_arrLocalFaultStruct[FAULT_LAST] =
+ {
+ /*VersionMismatch faults */
+ {"VersionMismatch", "Soap Version Mismatch error", "", ""},
+ /*MustUnderstand faults */
+ {"MustUnderstand", "Soap Must Understand error", "", ""},
+ /*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", "Soap method is not allowed to invoke", "", ""},
+ {"Client", "Parameter type mismatch", "", ""},
+ {"Client", "A client handler failed", "", ""},
+
+ /*Server faults */
+ {"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", "No handlers configured", "", ""},
+ {"Server", "Unknown error", "", ""}
+ };
+ s_parrSoapFaultStruct = s_arrLocalFaultStruct;
m_bInit = true;
}
}
+
const char* SoapFault::getSoapString()
{
return m_sFaultstring.c_str();
@@ -190,8 +168,8 @@
* returned SoapFault pointer
*/
SoapFault* SoapFault::getSoapFault(int iFaultCode)
-{
- SoapFaultStruct objFaultStruct = s_arrSoapFaultStruct[iFaultCode];
+{
+ const char* temp;
SoapFault* pSoapFault= NULL;
/* fill the soap fault object */
@@ -202,10 +180,10 @@
* gs_SoapEnvVersionsStruct should depend on the relevant SOAP VERSION
*/
pSoapFault->m_sFaultcode= string(gs_SoapEnvVersionsStruct[SOAP_VER_1_1].pchPrefix) +
- ":" + objFaultStruct.pcFaultcode;
- pSoapFault->m_sFaultstring= objFaultStruct.pcFaultstring;
- pSoapFault->m_sFaultactor= objFaultStruct.pcFaultactor;
- pSoapFault->m_sFaultDetail= objFaultStruct.pcFaultDetail;
+ ":" + s_parrSoapFaultStruct[iFaultCode].pcFaultcode;
+ pSoapFault->m_sFaultstring= s_parrSoapFaultStruct[iFaultCode].pcFaultstring;
+ pSoapFault->m_sFaultactor= s_parrSoapFaultStruct[iFaultCode].pcFaultactor;
+ pSoapFault->m_sFaultDetail= s_parrSoapFaultStruct[iFaultCode].pcFaultDetail;
return pSoapFault;
}