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 na...@apache.org on 2008/11/13 23:13:25 UTC
svn commit: r713841 [3/5] - in /webservices/axis/trunk/c/src: cbindings/
common/ engine/ engine/client/ engine/server/ platforms/aix/
platforms/hp-ux/ platforms/os400/ platforms/unix/ platforms/windows/
server/simple_axis_server/ soap/ transport/ trans...
Modified: webservices/axis/trunk/c/src/engine/client/Stub.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/Stub.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Stub.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Stub.cpp Thu Nov 13 14:13:23 2008
@@ -44,6 +44,10 @@
m_pExceptionHandler(NULL)
{
m_pCall = new Call ();
+
+ // Weird, yes, but need to do here since tracing is not enabled until after instantiation of Call class.
+ logEntryEngine("Stub::Stub")
+
m_pCall->setProtocol (eProtocol);
m_pTransport = m_pCall->getTransport ();
m_pTransport->setEndpointUri( pcEndPointUri);
@@ -67,10 +71,14 @@
pszArgPtr++;
}
}
+
+ logExit()
}
Stub::~Stub ()
{
+ logEntryEngine("Stub::~Stub")
+
delete m_pCall;
m_pCall = NULL;
@@ -80,24 +88,31 @@
delete m_vSOAPHeaderBlocks[j];
m_vSOAPHeaderBlocks[j] = NULL;
}
+
+ logExit()
}
void
Stub::setEndPoint (const char *pcEndPoint)
{
+ logEntryEngine("Stub::setEndPoint")
+
if (m_pTransport)
m_pTransport->setEndpointUri( pcEndPoint);
+
+ logExit()
}
void
Stub::setTransportProperty (const char *pcKey, const char *pcValue)
{
+ logEntryEngine("Stub::setTransportProperty")
+
if (m_pTransport)
{
if(!pcKey)
{
m_pTransport=NULL; //this should be set to null. otherwise the previous setting can be still there.
- return;
}
else if (strcmp (pcKey, "SOAPAction") == 0)
{
@@ -131,6 +146,8 @@
else
m_pTransport->setTransportProperty (pcKey, pcValue);
}
+
+ logExit()
}
const char *
@@ -192,7 +209,11 @@
void
Stub::setHandlerProperty (AxisChar * name, void *value, int len)
{
+ logEntryEngine("Stub::setHandlerProperty")
+
m_pCall->setHandlerProperty (name, value, len);
+
+ logExit()
}
IHeaderBlock *
@@ -251,16 +272,22 @@
void
Stub::deleteCurrentSOAPHeaderBlock ()
{
+ logEntryEngine("Stub::deleteCurrentSOAPHeaderBlock")
+
if (m_viCurrentSOAPHeaderBlock != m_vSOAPHeaderBlocks.end ())
{
delete (*m_viCurrentSOAPHeaderBlock);
m_vSOAPHeaderBlocks.erase (m_viCurrentSOAPHeaderBlock);
}
+
+ logExit()
}
void
Stub::deleteSOAPHeaderBlock (IHeaderBlock * pHeaderBlock)
{
+ logEntryEngine("Stub::deleteSOAPHeaderBlock")
+
vector < IHeaderBlock * >::iterator currentSOAPHeaderBlock =
m_vSOAPHeaderBlocks.begin ();
bool bDone = false;
@@ -274,11 +301,15 @@
}
currentSOAPHeaderBlock++;
}
+
+ logExit()
}
void
Stub::setSOAPHeaders ()
{
+ logEntryEngine("Stub::setSOAPHeaders")
+
SoapSerializer *pSerializer = NULL;
if (m_pCall)
pSerializer = m_pCall->getSOAPSerializer ();
@@ -286,26 +317,40 @@
if (pSerializer)
for (unsigned int i = 0; i < m_vSOAPHeaderBlocks.size (); i++)
pSerializer->addHeaderBlock (m_vSOAPHeaderBlocks[i]);
+
+ logExit()
}
void
Stub::applyUserPreferences ()
{
+ logEntryEngine("Stub::applyUserPreferences")
+
setSOAPHeaders ();
+
+ logExit()
}
void
Stub::setProxy (const char *pcProxyHost, unsigned int uiProxyPort)
{
+ logEntryEngine("Stub::setProxy")
+
if (m_pTransport)
m_pTransport->setProxy (pcProxyHost, uiProxyPort);
+
+ logExit()
}
void
Stub::setTransportTimeout (long lSeconds)
{
+ logEntryEngine("Stub::setTransportTimeout")
+
if (m_pTransport)
m_pTransport->setTimeout (lSeconds);
+
+ logExit()
}
int
@@ -372,20 +417,24 @@
void
Stub::setProxyUsername (const char *pcProxyUsername)
{
+ logEntryEngine("Stub::setProxyUsername")
+
if (m_proxyUsername)
{
delete[]m_proxyUsername;
m_proxyUsername = NULL;
}
- if (!pcProxyUsername)
- return;
-
- m_proxyUsername = new char[strlen (pcProxyUsername) + 1];
- strcpy (m_proxyUsername, pcProxyUsername);
-
- if (m_proxyPassword)
- setProxyAuthorizationHeader ();
+ if (pcProxyUsername)
+ {
+ m_proxyUsername = new char[strlen (pcProxyUsername) + 1];
+ strcpy (m_proxyUsername, pcProxyUsername);
+
+ if (m_proxyPassword)
+ setProxyAuthorizationHeader ();
+ }
+
+ logExit()
}
void
@@ -404,14 +453,14 @@
m_proxyPassword = NULL;
}
- if (!pcProxyPassword)
- return;
-
- m_proxyPassword = new char[strlen (pcProxyPassword) + 1];
- strcpy (m_proxyPassword, pcProxyPassword);
-
- if (m_proxyUsername)
- setProxyAuthorizationHeader ();
+ if (pcProxyPassword)
+ {
+ m_proxyPassword = new char[strlen (pcProxyPassword) + 1];
+ strcpy (m_proxyPassword, pcProxyPassword);
+
+ if (m_proxyUsername)
+ setProxyAuthorizationHeader ();
+ }
}
@@ -432,6 +481,8 @@
void
Stub::setProxyAuthorizationHeader ()
{
+ logEntryEngine("Stub::setProxyAuthorizationHeader")
+
char* cpUsernamePassword = new char[strlen( m_proxyUsername) + strlen( m_proxyPassword ) + 2];
strcpy( cpUsernamePassword, m_proxyUsername );
strcat( cpUsernamePassword, ":" );
@@ -447,26 +498,38 @@
this->setTransportProperty( "Proxy-Authorization", strValue.c_str());
delete [] cpUsernamePassword;
delete [] base64Value;
+
+ logExit()
}
ISoapAttachment* Stub::createSoapAttachment()
{
+ logEntryEngine("Stub::createSoapAttachment")
+
return m_pCall->createSoapAttachment();
+
+ logExit()
}
/*Methods for supporting SecureChannel*/
void Stub::SetSecure( char * pszArguments, ...)
{
+ logEntryEngine("Stub::SetSecure")
+
va_list args;
va_start( args, pszArguments);
SetSecure(pszArguments, args);
va_end( args);
+
+ logExit()
}
/*Methods for supporting SecureChannel*/
void Stub::SetSecure( char * pszArguments, va_list args)
{
+ logEntryEngine("Stub::SetSecure")
+
int iArgIndex = 0;
char * pszArg = pszArguments;
@@ -483,6 +546,8 @@
if( iArgIndex == 6)
m_sArguments[iArgIndex] = "false";
}
+
+ logExit()
}
void Stub::includeSecure()
@@ -493,11 +558,19 @@
void
Stub::checkForExtraneousElements ()
{
+ logEntryEngine("Stub::checkForExtraneousElements")
+
IWrapperSoapDeSerializer *pDeSerializer = m_pCall->getSOAPDeSerializer();
- if (!pDeSerializer)
- return;
-
- const char *peekedElementName = pDeSerializer->peekNextElementName();
- if (0x00 != *peekedElementName)
- throw UnknownElementException(peekedElementName);
+ if (pDeSerializer)
+ {
+ const char *peekedElementName = pDeSerializer->peekNextElementName();
+ if (0x00 != *peekedElementName)
+ {
+ logThrowExceptionWithData("UnknownElementException", peekedElementName)
+
+ throw UnknownElementException(peekedElementName);
+ }
+ }
+
+ logExit()
}
Modified: webservices/axis/trunk/c/src/engine/server/ServerAxisEngine.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/server/ServerAxisEngine.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/server/ServerAxisEngine.cpp (original)
+++ webservices/axis/trunk/c/src/engine/server/ServerAxisEngine.cpp Thu Nov 13 14:13:23 2008
@@ -34,33 +34,40 @@
ServerAxisEngine::
ServerAxisEngine ()
{
+ logEntryEngine("ServerAxisEngine::ServerAxisEngine")
+
m_pWebService = NULL;
+
+ logExit()
}
ServerAxisEngine::
~ServerAxisEngine ()
{
-
+ logEntryEngine("ServerAxisEngine::~ServerAxisEngine")
+
+ logExit()
}
int ServerAxisEngine::
process (SOAPTransport * pStream)
{
+ logEntryEngine("ServerAxisEngine::process")
+
int Status = 0;
int nSoapVersion;
try
{
if (!pStream)
{
- AXISTRACE1 ("transport is not set properly", CRITICAL);
+ logThrowException("AxisConfigException - SERVER_CONFIG_TRANSPORT_CONF_FAILED")
+
throw AxisConfigException (SERVER_CONFIG_TRANSPORT_CONF_FAILED);
}
string sSessionId = pStream->getSessionId ();
- /*
- * After this point we should return AXIS_SUCCESS. Otherwise the transport
- * layer may not send the response back (either soap fault or result).
- */
+ // After this point we should return AXIS_SUCCESS. Otherwise the transport
+ // layer may not send the response back (either soap fault or result).
do
{
/* populate MessageData with transport information */
@@ -71,17 +78,18 @@
nSoapVersion = m_pDZ->getVersion ();
nSoapVersion = (nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
const char *cService = pStream->getTransportProperty (SERVICE_URI);
if (!cService)
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
AxisString service = (cService == NULL) ? "" : cService;
@@ -90,10 +98,12 @@
nSoapVersion = m_pMsgData->m_pDZ->getVersion ();
nSoapVersion = (nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1 ("CLIENT_SOAP_SOAP_ACTION_EMTPY", CRITICAL);
+
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_ACTION_EMTPY")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_ACTION_EMTPY);
- break; // do .. while(0)
}
+
// if there are quotes remove them.
if (service.find ('\"') != string::npos)
{
@@ -107,9 +117,10 @@
nSoapVersion = m_pMsgData->m_pDZ->getVersion ();
nSoapVersion = (nSoapVersion == VERSION_LAST) ? SOAP_VER_1_2 : nSoapVersion;
m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion);
- AXISTRACE1 ("CLIENT_WSDD_SERVICE_NOT_FOUND", CRITICAL);
+
+ logThrowExceptionWithData("AxisWsddException - CLIENT_WSDD_SERVICE_NOT_FOUND", service.c_str())
+
throw AxisWsddException (CLIENT_WSDD_SERVICE_NOT_FOUND, service.c_str());
- break; // do .. while(0)
}
m_CurrentProviderType = m_pService->getProvider ();
@@ -141,25 +152,26 @@
nSoapVersion = m_pDZ->getVersion ();
if (m_pDZ->getStatus () != AXIS_SUCCESS)
{
- AXISTRACE1 ("CLIENT_SOAP_MESSAGE_INCOMPLETE", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_MESSAGE_INCOMPLETE")
+
throw AxisSoapException (CLIENT_SOAP_MESSAGE_INCOMPLETE);
- break; // do .. while(0)
}
if (nSoapVersion == VERSION_LAST) // version not supported
{
m_pSZ->setSoapVersion (SOAP_VER_1_2);
- AXISTRACE1 ("SOAP_VERSION_MISMATCH", CRITICAL);
+
+ logThrowException("AxisSoapException - SOAP_VERSION_MISMATCH")
+
throw AxisSoapException (SOAP_VERSION_MISMATCH);
- break; // do .. while(0)
}
/* Set Soap version in the Serializer and the envelope */
if (AXIS_SUCCESS != m_pSZ->setSoapVersion ((SOAP_VERSION) nSoapVersion))
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
/* Get the operation name from transport information Ex: from
@@ -167,24 +179,24 @@
*/
if (AXIS_SUCCESS != m_pDZ->getHeader ())
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
if (AXIS_SUCCESS != m_pDZ->getBody ())
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
AxisString sOperation = m_pDZ->getMethodNameToInvoke ();
if (sOperation.empty ())
{
- AXISTRACE1 ("CLIENT_SOAP_NO_SOAP_METHOD", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_NO_SOAP_METHOD")
+
throw AxisSoapException (CLIENT_SOAP_NO_SOAP_METHOD);
- break; // do .. while(0)
}
/* remove any quotes in the operation name */
if (sOperation.rfind ('\"') != string::npos)
@@ -201,10 +213,9 @@
/* load actual web service handler */
if (AXIS_SUCCESS != g_pHandlerPool->getWebService (&m_pWebService, sSessionId, m_pService))
{
- /* error : couldnot load web service */
- AXISTRACE1 ("SERVER_ENGINE_COULD_NOT_LOAD_SRV", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_COULD_NOT_LOAD_SRV")
+
throw AxisEngineException(SERVER_ENGINE_COULD_NOT_LOAD_SRV);
- break; // do .. while(0)
}
/* Check whether the provider type in the wsdd matchs the service's
@@ -223,71 +234,56 @@
if (m_pSZ->getStyle () != nBindingStyle)
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ logThrowException("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR")
+
throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR);
- break; // do .. while(0)
}
}
else
{
- AXISTRACE1 ("CLIENT_WSDD_METHOD_NOT_ALLOWED", CRITICAL);
+ logThrowException("AxisWsddException - CLIENT_WSDD_METHOD_NOT_ALLOWED")
+
throw AxisWsddException (CLIENT_WSDD_METHOD_NOT_ALLOWED);
- // Method is not an exposed allowed method
- break; // do .. while(0)
}
// Get Global and Transport Handlers
if (AXIS_SUCCESS != (Status = initializeHandlers (sSessionId,pStream->getProtocol())))
{
- AXISTRACE1 ("SERVER_ENGINE_COULD_NOT_LOAD_HDL", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_COULD_NOT_LOAD_HDL")
+
throw AxisEngineException (SERVER_ENGINE_COULD_NOT_LOAD_HDL);
- break; // do .. while(0)
}
// Get Service specific Handlers from the pool if configured any
- if (AXIS_SUCCESS !=
- (Status =
- g_pHandlerPool->getRequestFlowHandlerChain (&m_pSReqFChain,sSessionId,m_pService)))
+ if (AXIS_SUCCESS != (Status = g_pHandlerPool->getRequestFlowHandlerChain (&m_pSReqFChain,sSessionId,m_pService)))
{
- AXISTRACE1 ("SERVER_ENGINE_COULD_NOT_LOAD_HDL", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_COULD_NOT_LOAD_HDL")
+
throw AxisEngineException (SERVER_ENGINE_COULD_NOT_LOAD_HDL);
- break; // do .. while(0)
}
- if (AXIS_SUCCESS != (Status =
- g_pHandlerPool->getResponseFlowHandlerChain (&m_pSResFChain,sSessionId,m_pService)))
+ if (AXIS_SUCCESS != (Status = g_pHandlerPool->getResponseFlowHandlerChain (&m_pSResFChain,sSessionId,m_pService)))
{
- AXISTRACE1 ("SERVER_ENGINE_COULD_NOT_LOAD_HDL", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_COULD_NOT_LOAD_HDL")
+
throw AxisEngineException (SERVER_ENGINE_COULD_NOT_LOAD_HDL);
- break; // do .. while(0)
}
- /*
- * Invoke all handlers including the webservice
- * in case of failure coresponding stream fault message will be set
- */
+ // Invoke all handlers
Status = invoke (m_pMsgData);
}
while (0);
if (AXIS_SUCCESS != m_pDZ->flushInputStream ())
{
- AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
}
- /*
- * Get any header blocks unprocessed (left) in the Deserializer and add them
- * to the Serializer
- * They may be headers targetted to next soap processors
- */
+ // Get any header blocks unprocessed (left) in the Deserializer and add them
+ // to the Serializer. They may be headers targetted to next soap processors.
HeaderBlock *pHderBlk = NULL;
while (true)
{
- /* Following function gets a header block from Deserializer irrespective
- * of any thing
- */
pHderBlk = m_pDZ->getHeaderBlock ();
- /* Add it to the Serializer */
if (pHderBlk)
m_pSZ->addHeaderBlock (pHderBlk);
else
@@ -307,19 +303,14 @@
}
catch (AxisException & e)
{
- /*
- * An exception which is not handled will be handled here.
- */
+ // An exception which is not handled will be handled here.
int iExceptionCode = e.getExceptionCode ();
- //char* pcTempStr = (char*) e.what();
- //AXISTRACE2("Exception:", pcTempStr, CRITICAL);
if (AXISC_SERVICE_THROWN_EXCEPTION == iExceptionCode)
{
- /*Writes the SoapMessage in which soap body contains only Fault */
+ // Writes the SoapMessage in which soap body contains only Fault
m_pSZ->setOutputStream (pStream);
releaseHandlers (pStream);
- return AXIS_SUCCESS; //Service created fault is written to the stream.
- //so return success.
+ return AXIS_SUCCESS;
}
else
{
@@ -333,20 +324,27 @@
catch (exception& e)
{
e = e;
- /* Handle standerd exceptions here */
- AxisTrace::trace(e.what());
- return SERVER_UNKNOWN_ERROR;
+ logExitWithReturnCode(SERVER_UNKNOWN_ERROR)
+
+ return SERVER_UNKNOWN_ERROR;
}
catch (...)
{
- return SERVER_UNKNOWN_ERROR;
+ logExitWithReturnCode(SERVER_UNKNOWN_ERROR)
+
+ return SERVER_UNKNOWN_ERROR;
}
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
int ServerAxisEngine::
invoke (MessageData * pMsg)
{
+ logEntryEngine("ServerAxisEngine::invoke")
+
enum AE_LEVEL { AE_START = 1, AE_TRH, AE_GLH, AE_SERH, AE_SERV };
int Status = AXIS_FAIL;
int level = AE_START;
@@ -356,9 +354,9 @@
if (m_pTReqFChain)
if (AXIS_SUCCESS != (Status = m_pTReqFChain->invoke (pMsg)))
{
- AXISTRACE1 ("SERVER_ENGINE_HANDLER_FAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_FAILED")
+
throw AxisEngineException (SERVER_ENGINE_HANDLER_FAILED);
- break; // do .. while (0)
}
level++; // AE_TRH
@@ -366,9 +364,9 @@
if (m_pGReqFChain)
if (AXIS_SUCCESS != (Status = m_pGReqFChain->invoke (pMsg)))
{
- AXISTRACE1 ("SERVER_ENGINE_HANDLER_FAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_FAILED")
+
throw AxisEngineException (SERVER_ENGINE_HANDLER_FAILED);
- break; // do .. while (0)
}
level++; // AE_GLH
@@ -376,9 +374,9 @@
if (m_pSReqFChain)
if (AXIS_SUCCESS != (Status = m_pSReqFChain->invoke (pMsg)))
{
- AXISTRACE1 ("SERVER_ENGINE_HANDLER_FAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_FAILED")
+
throw AxisEngineException (SERVER_ENGINE_HANDLER_FAILED);
- break; // do .. while (0)
}
level++; // AE_SERH
@@ -390,9 +388,9 @@
*/
if (m_pDZ->isAnyMustUnderstandHeadersLeft ())
{
- AXISTRACE1 ("SOAP_MUSTUNDERSTAND", CRITICAL);
+ logThrowException("AxisSoapException - SOAP_MUST_UNDERSTAND")
+
throw AxisSoapException (SOAP_MUST_UNDERSTAND);
- break; // do .. while (0)
}
// Call actual web service handler
@@ -415,9 +413,9 @@
if (AXIS_SUCCESS != Status)
{
- AXISTRACE1 ("SERVER_ENGINE_WEBSERVICEFAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_WEBSERVICE_FAILED")
+
throw AxisEngineException (SERVER_ENGINE_WEBSERVICE_FAILED);
- break;
}
}
level++; // AE_SERV
@@ -455,40 +453,57 @@
case AE_START:; // Transport handlers have failed
};
+ logExitWithReturnCode(Status)
+
return Status;
}
void ServerAxisEngine::
onFault (MessageData * pMsg)
{
+ logEntryEngine("ServerAxisEngine::onFault")
+
+ logExit()
}
int ServerAxisEngine::
setFaultOutputStream (int iFaultCode, SOAPTransport * pStream)
{
+ logEntryEngine("ServerAxisEngine::setFaultOutputStream")
+
string sMessage = AxisException::getMessageForExceptionCode(iFaultCode);
SoapFault *pObjSoapFault = SoapFault::getSoapFault (iFaultCode);
pObjSoapFault->setFaultDetail (sMessage.c_str ());
m_pSZ->setSoapFault (pObjSoapFault);
m_pSZ->setOutputStream (pStream);
releaseHandlers (pStream);
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
int ServerAxisEngine::
setFaultOutputStream (AxisException iFault, SOAPTransport * pStream)
{
+ logEntryEngine("ServerAxisEngine::setFaultOutputStream")
+
SoapFault *pObjSoapFault = SoapFault::getSoapFault (iFault.getExceptionCode());
pObjSoapFault->setFaultDetail (iFault.what());
m_pSZ->setSoapFault (pObjSoapFault);
m_pSZ->setOutputStream (pStream);
releaseHandlers (pStream);
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
int ServerAxisEngine::
releaseHandlers (SOAPTransport * pStream)
{
+ logEntryEngine("ServerAxisEngine::releaseHandlers")
+
string sSessionId = pStream->getSessionId ();
// Pool back the Service specific handlers
if (m_pSReqFChain)
@@ -504,6 +519,8 @@
if (m_pWebService)
g_pHandlerPool->poolWebService (sSessionId, m_pWebService, m_pService);
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp Thu Nov 13 14:13:23 2008
@@ -19,6 +19,8 @@
#if !defined(_PLATFORM_SPECIFIC_AIX_HPP)
#define _PLATFORM_SPECIFIC_AIX_HPP
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_S "/"
// =============================================================
// Default paths to shared library/DLLs and files
@@ -124,6 +126,13 @@
#define PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "lld"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER "%llu"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER_CHARS "llu"
+#define PRINTF_LONGLONG_LOG_FORMAT_SPECIFIER "%.8llu"
+
+/**
+ * File modes
+ */
+#define TRACE_FILE_MODE1 "a"
+#define TRACE_FILE_MODE2 "a"
#endif
Modified: webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp Thu Nov 13 14:13:23 2008
@@ -21,6 +21,9 @@
#include <string>
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_S "/"
+
// =============================================================
// Default paths to shared library/DLLs and files
// =============================================================
@@ -123,6 +126,13 @@
#define PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "lld"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER "%llu"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER_CHARS "llu"
+#define PRINTF_LONGLONG_LOG_FORMAT_SPECIFIER "%.8llu"
+
+/**
+ * File modes
+ */
+#define TRACE_FILE_MODE1 "a"
+#define TRACE_FILE_MODE2 "a"
#endif
Modified: webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp Thu Nov 13 14:13:23 2008
@@ -29,6 +29,9 @@
#include <unistd.h> // access()
#include <string>
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_S "/"
+
// =============================================================
// Default paths to shared library/DLLs and files
// =============================================================
@@ -40,8 +43,8 @@
#define PLATFORM_CHANNEL_PATH PLATFORM_DEFAULT_DEPLOY_PATH "libhttp_channel.so"
#define PLATFORM_SSLCHANNEL_PATH PLATFORM_DEFAULT_DEPLOY_PATH "Unknown"
-#define PLATFORM_LOG_PATH "/usr/local/axiscpp_deploy/log/AxisLog"
-#define PLATFORM_CLIENTLOG_PATH "/usr/local/axiscpp_deploy/log/AxisClientLog"
+#define PLATFORM_LOG_PATH ""
+#define PLATFORM_CLIENTLOG_PATH ""
#define PLATFORM_CONFIG_PATH "/etc/axiscpp.conf"
#define PLATFORM_SECUREINFO ""
@@ -112,7 +115,13 @@
/**
* Platform specific method to obtain current thread ID
*/
-#define PLATFORM_GET_THREAD_ID pthread_self()
+#define PLATFORM_GET_THREAD_ID os400_getThreadID()
+
+inline long long os400_getThreadID()
+{
+ pthread_id_np_t tid = pthread_getthreadid_np();
+ return *((long long *)&tid);
+}
/**
* Platform specific method to obtain current time in milli seconds
@@ -150,23 +159,12 @@
#define PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "lld"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER "%llu"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER_CHARS "llu"
+#define PRINTF_LONGLONG_LOG_FORMAT_SPECIFIER "%.8llu"
/**
- * For debugging
+ * File modes
*/
-static void traceData(void *d, int length)
-{
- char logFile[1024];
- sprintf(logFile, "/tmp/axis.log");
- FILE *fh = fopen(logFile, "ab, codepage=819");
- setvbuf(fh, NULL, _IOFBF, (size_t)(4*1024));
- fwrite(d, 1, length, fh);
- fwrite("\x0d\x0a\x2b\x2b\x2b\x2b\x2b\x2b\x0d\x0a", 1, 10, fh);
- fflush(fh);
- fclose(fh);
-}
-
+#define TRACE_FILE_MODE1 "a, o_ccsid=1208, crln=N"
+#define TRACE_FILE_MODE2 "a, o_ccsid=0, crln=N"
#endif
-
-
Modified: webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp Thu Nov 13 14:13:23 2008
@@ -21,6 +21,10 @@
#include <string>
+
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_S "/"
+
// =============================================================
// Default paths to shared library/DLLs and files
// =============================================================
@@ -123,6 +127,13 @@
#define PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "lld"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER "%llu"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER_CHARS "llu"
+#define PRINTF_LONGLONG_LOG_FORMAT_SPECIFIER "%.8llu"
+
+/**
+ * File modes
+ */
+#define TRACE_FILE_MODE1 "a"
+#define TRACE_FILE_MODE2 "a"
#endif
Modified: webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp Thu Nov 13 14:13:23 2008
@@ -61,6 +61,9 @@
#include <string>
#include <sys/timeb.h>
+#define DIR_SEPARATOR '\\'
+#define DIR_SEPARATOR_S "\\"
+
// =============================================================
// Default paths to shared library/DLLs and files
// =============================================================
@@ -140,6 +143,7 @@
#define PRINTF_LONGLONG_FORMAT_SPECIFIER_CHARS "I64d"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER "%I64u"
#define PRINTF_UNSIGNED_LONGLONG_FORMAT_SPECIFIER_CHARS "I64u"
+#define PRINTF_LONGLONG_LOG_FORMAT_SPECIFIER "%.8I64u"
/**
* Platform specific method to obtain current thread ID
@@ -156,6 +160,12 @@
HMODULE callLoadLib(LPCTSTR lib);
+/**
+ * File modes
+ */
+#define TRACE_FILE_MODE1 "a"
+#define TRACE_FILE_MODE2 "a"
+
#endif
Modified: webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp (original)
+++ webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp Thu Nov 13 14:13:23 2008
@@ -114,9 +114,6 @@
}
/* clntSock is connected to a client! */
- /*
- * AXISTRACE3(strcat("Handling client ", inet_ntoa(echoClntAddr.sin_addr)));
- */
return clntSock;
}
@@ -242,8 +239,6 @@
handleTCPClient (acceptTCPConnection (servSock[0]));
}
}
-
- // AXISTRACE3("end of main while");
}
//uninitializing Axis
@@ -269,7 +264,5 @@
#else //Linux
#endif
- //AXISTRACE3("End of main");
-
return 0;
}
Modified: webservices/axis/trunk/c/src/soap/HeaderBlock.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/HeaderBlock.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/HeaderBlock.cpp (original)
+++ webservices/axis/trunk/c/src/soap/HeaderBlock.cpp Thu Nov 13 14:13:23 2008
@@ -48,24 +48,49 @@
extern SoapEnvVersionsStruct gs_SoapEnvVersionsStruct[VERSION_LAST];
-HeaderBlock::HeaderBlock()
+HeaderBlock::
+HeaderBlock()
{
+ logEntryEngine("HeaderBlock::HeaderBlock")
+
iNoOFChildren = 0;
m_sPrefix = "";
+
+ logExit()
}
-HeaderBlock::HeaderBlock(const AxisChar *pachLocalName, const AxisChar *pachUri)
+HeaderBlock::
+HeaderBlock(const AxisChar *pachLocalName, const AxisChar *pachUri)
{
+ logEntryEngine("HeaderBlock::HeaderBlock")
+
iNoOFChildren = 0;
m_localname = pachLocalName;
m_uri = pachUri;
m_sPrefix = "";
+
+ logExit()
+}
+
+HeaderBlock::
+HeaderBlock(const AxisChar *pachLocalName, const AxisChar *pachUri, const AxisChar *pachPrefix)
+{
+ logEntryEngine("HeaderBlock::HeaderBlock")
+
+ iNoOFChildren = 0;
+ m_localname = pachLocalName;
+ m_uri = pachUri;
+ m_sPrefix = pachPrefix;
+
+ logExit()
}
-HeaderBlock::HeaderBlock(const HeaderBlock& rCopy):
+HeaderBlock::
+HeaderBlock(const HeaderBlock& rCopy):
IHeaderBlock(rCopy), iNoOFChildren(rCopy.iNoOFChildren), m_localname(rCopy.m_localname),
m_sPrefix(rCopy.m_sPrefix), m_uri(rCopy.m_uri)
{
+ logEntryEngine("HeaderBlock::HeaderBlock")
list<BasicNode*>::const_iterator itCurrChild= rCopy.m_children.begin();
while(itCurrChild != rCopy.m_children.end())
@@ -90,15 +115,20 @@
itCurrNamespace++;
}
*/
+ logExit()
}
-IHeaderBlock* HeaderBlock::clone()
+IHeaderBlock* HeaderBlock::
+clone()
{
return new HeaderBlock(*this);
}
-HeaderBlock::~HeaderBlock()
+HeaderBlock::
+~HeaderBlock()
{
+ logEntryEngine("HeaderBlock::~HeaderBlock")
+
// Clear the Attributes
list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
while(itCurrAttribute != m_attributes.end())
@@ -125,72 +155,86 @@
itCurrChild++;
}
m_children.clear();
+
+ logExit()
}
-int HeaderBlock::setLocalName(const AxisChar* localname)
+int HeaderBlock::
+setLocalName(const AxisChar* localname)
{
- if(localname==NULL)
+ logEntryEngine("HeaderBlock::setLocalName")
+
+ int Status = AXIS_FAIL;
+
+ if(localname)
{
- return AXIS_FAIL;
+ m_localname=localname;
+ Status = AXIS_SUCCESS;
}
- m_localname=localname;
- return AXIS_SUCCESS;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-const AxisChar * HeaderBlock::getLocalName()
+const AxisChar * HeaderBlock::
+getLocalName()
{
return m_localname.c_str();
}
-/*
- * Commented by Susantha - 21/06/2004
- * The prefix should be decided by the Serializer at runtime
- *
- * Uncommented by Mark Whitlock - 24/8/04 after discussion
- * on the mailing list agreed to add back in this method.
- * Jira issue AXISCPP-135
- */
-int HeaderBlock::setPrefix(const AxisChar* prefix)
+
+int HeaderBlock::
+setPrefix(const AxisChar* prefix)
{
+ logEntryEngine("HeaderBlock::setPrefix")
+
if(prefix)
- {
m_sPrefix= prefix;
- }
else
- {
m_sPrefix="";
- }
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HeaderBlock::setURI(const AxisChar* uri)
+int HeaderBlock::
+setURI(const AxisChar* uri)
{
+ logEntryEngine("HeaderBlock::setURI")
+
if(uri)
- {
m_uri= uri;
- }
else
- {
m_uri="";
- }
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HeaderBlock::addAttribute(Attribute* pAttr)
+int HeaderBlock::
+addAttribute(Attribute* pAttr)
{
+ logEntryEngine("HeaderBlock::addAttribute")
+
+ int Status = AXIS_FAIL;
if (pAttr)
{
m_attributes.push_back(pAttr);
- return AXIS_SUCCESS;
- }
- else
- {
- return AXIS_FAIL;
+ Status = AXIS_SUCCESS;
}
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HeaderBlock::serialize(SoapSerializer& pSZ)
+int HeaderBlock::
+serialize(SoapSerializer& pSZ)
{
-
+ logEntryEngine("HeaderBlock::serialize")
+
/*
*In the code we don't look whether the m_sPrefix is available or
* not. Instead directly insert it. The reason is that the SOAP
@@ -205,25 +249,18 @@
do
{
- /*
- * TO DO: ReWrite the following logic to deal with name spaces
- */
-
+ // TO DO: ReWrite the following logic to deal with name spaces
pSZ.serialize("<", NULL);
if(m_sPrefix.length() == 0)
{
- m_sPrefix = pSZ.getNamespacePrefix(m_uri.c_str(),
- blnIsNewNamespace);
+ m_sPrefix = pSZ.getNamespacePrefix(m_uri.c_str(), blnIsNewNamespace);
if (blnIsNewNamespace)
- {
lstTmpNameSpaceStack.push_back((AxisChar*)m_uri.c_str());
- }
- } else {
- /* The use has specified his/her own prefix. Therefore this is
- taken as a new namespace and will be declared as a namespace
- declaration.
- */
+ }
+ else
+ {
+ // new namespace and will be declared as a namespace declaration.
blnIsNewNamespace = true;
/* Adding to the Serializers namespace list b'cas the child
elements of this HeaderBlock might use this namespace, so that they
@@ -239,52 +276,48 @@
pSZ.serialize(m_sPrefix.c_str(), ":", m_localname.c_str(), NULL);
- if (blnIsNewNamespace) {
+ if (blnIsNewNamespace)
pSZ.serialize(" xmlns:", m_sPrefix.c_str(), "=\"", m_uri.c_str(), "\"", NULL);
- }
iStatus= attrSerialize(pSZ, lstTmpNameSpaceStack);
if(iStatus==AXIS_FAIL)
- {
break;
- }
iStatus= serializeNamespaceDecl(pSZ, lstTmpNameSpaceStack);
if(iStatus==AXIS_FAIL)
- {
break;
- }
pSZ.serialize(">", NULL);
iStatus= serializeChildren(pSZ, lstTmpNameSpaceStack);
if(iStatus==AXIS_FAIL)
- {
break;
- }
- pSZ.serialize("</", m_sPrefix.c_str(), ":", m_localname.c_str(), ">",
- NULL);
+ pSZ.serialize("</", m_sPrefix.c_str(), ":", m_localname.c_str(), ">", NULL);
- /*
- * Removing the namespace list of this headerblock from the stack.
- */
- list<AxisChar*>::iterator itCurrentNamespace =
- lstTmpNameSpaceStack.begin();
+ // Removing the namespace list of this headerblock from the stack.
+ list<AxisChar*>::iterator itCurrentNamespace = lstTmpNameSpaceStack.begin();
while (itCurrentNamespace != lstTmpNameSpaceStack.end())
{
pSZ.removeNamespacePrefix(*itCurrentNamespace);
itCurrentNamespace++;
}
- } while(0);
+ }
+ while(0);
+
m_sPrefix = "";
+
+ logExitWithReturnCode(iStatus)
+
return iStatus;
}
-int HeaderBlock::attrSerialize(SoapSerializer& pSZ,
- list<AxisChar*>& lstTmpNameSpaceStack)
+int HeaderBlock::
+attrSerialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack)
{
+ logEntryEngine("HeaderBlock::attrSerialize")
+
int iStatus= AXIS_SUCCESS;
list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
@@ -317,126 +350,137 @@
itCurrAttribute++;
}
+ logExitWithReturnCode(iStatus)
+
return iStatus;
}
-bool HeaderBlock::isSerializable()
+bool HeaderBlock::
+isSerializable()
{
+ logEntryEngine("HeaderBlock::isSerializable")
+
bool bStatus= true;
if(m_localname.length() == 0)
- {
bStatus= false;
- }
else
{
if(m_sPrefix.length() == 0)
{
if(m_uri.length() != 0)
- {
bStatus= false;
- }
}
else
{
if(m_uri.length() == 0)
- {
bStatus= false;
- }
}
}
+
+ logExitWithBoolean(bStatus)
return bStatus;
}
-int HeaderBlock::addChild(BasicNode *pBasicNode)
+int HeaderBlock::
+addChild(BasicNode *pBasicNode)
{
+ logEntryEngine("HeaderBlock::addChild")
+
+ int iStatus = AXIS_FAIL;
+
if (pBasicNode)
{
m_children.push_back(pBasicNode);
iNoOFChildren++;
- return AXIS_SUCCESS;
- }
- else
- {
- return AXIS_FAIL;
+ iStatus = AXIS_SUCCESS;
}
+
+ logExitWithReturnCode(iStatus)
+
+ return iStatus;
}
-int HeaderBlock::serializeChildren(SoapSerializer& pSZ,
- list<AxisChar *>& lstTmpNameSpaceStack)
+int HeaderBlock::
+serializeChildren(SoapSerializer& pSZ, list<AxisChar *>& lstTmpNameSpaceStack)
{
+ logEntryEngine("HeaderBlock::serializeChildren")
+
int iStatus = AXIS_SUCCESS;
-// SOAP serialiser does not have an == operator so can't check it
+ // SOAP serialiser does not have an == operator so can't check it
list<BasicNode*>::iterator itCurrBasicNode = m_children.begin();
while( itCurrBasicNode != m_children.end() && iStatus == AXIS_SUCCESS)
{
if ((*itCurrBasicNode)->getNodeType() == ELEMENT_NODE)
{
-// Processing for ELEMENT_NODE types
+ // Processing for ELEMENT_NODE types
iStatus = (*itCurrBasicNode)->serialize( pSZ, lstTmpNameSpaceStack);
}
else
{
-// Processing for CHARACTER_NODE types
+ // Processing for CHARACTER_NODE types
iStatus = (*itCurrBasicNode)->serialize( pSZ);
}
itCurrBasicNode++;
}
+ logExitWithReturnCode(iStatus)
+
return iStatus;
}
-INamespace* HeaderBlock::createNamespaceDecl( const AxisChar * pPrefix, const AxisChar * pURI)
+INamespace* HeaderBlock::
+createNamespaceDecl( const AxisChar * pPrefix, const AxisChar * pURI)
{
-// Check that the prefix and uri are valid pointers and that the string is not
-// empty.
- if( pPrefix != NULL && strlen( pPrefix) > 0 &&
- pURI != NULL && strlen( pURI) > 0)
- {
+ logEntryEngine("HeaderBlock::createNamespaceDecl")
+
+ INamespace* returnPtr = NULL;
-// Iterate through the namespaces checking that the prefix does not already
-// exist.
- bool bNameFound = false;
+ // Check that the prefix and uri are valid pointers and that the string is not empty.
+ if( pPrefix != NULL && strlen( pPrefix) > 0 && pURI != NULL && strlen( pURI) > 0)
+ {
+ // Iterate through the namespaces checking that the prefix does not already exist.
+ bool bNameFound = false;
list<Namespace*>::iterator itCurrNamespaceDecl = m_namespaceDecls.begin();
while( itCurrNamespaceDecl != m_namespaceDecls.end() && !bNameFound)
{
if( !(bNameFound = !strcmp( (*itCurrNamespaceDecl)->getPrefix(), pPrefix)))
- {
itCurrNamespaceDecl++;
- }
}
-// If the prefix is found in the declared namespace list, then update the uri
-// for the prefix and return a pointer to that namespace.
+ // If the prefix is found in the declared namespace list, then update the uri
+ // for the prefix and return a pointer to that namespace.
+ // If the prefix was not found, then create a new namespace for the prefix/uri
+ // pair and return the pointer to the new namespace.
if( bNameFound)
{
(*itCurrNamespaceDecl)->setURI( pURI);
-
- return (INamespace *) *itCurrNamespaceDecl;
+ returnPtr = (INamespace *) *itCurrNamespaceDecl;
+ }
+ else
+ {
+ Namespace * pNamespace = new Namespace( pPrefix, pURI);
+ m_namespaceDecls.push_back( pNamespace);
+ returnPtr = (INamespace *) pNamespace;
}
-
-// If the prefix was not found, then create a new namespace for the prefix/uri
-// pair and return the pointer to the new namespace.
- Namespace * pNamespace = new Namespace( pPrefix, pURI);
-
- m_namespaceDecls.push_back( pNamespace);
-
- return (INamespace *) pNamespace;
- }
- else
- {
- return NULL;
}
+
+ logExitWithPointer(returnPtr)
+
+ return returnPtr;
}
-int HeaderBlock::serializeNamespaceDecl(SoapSerializer &pSZ, std::list<AxisChar*>& lstTmpNameSpaceStack)
+int HeaderBlock::
+serializeNamespaceDecl(SoapSerializer &pSZ, std::list<AxisChar*>& lstTmpNameSpaceStack)
{
+ logEntryEngine("HeaderBlock::serializeNamespaceDecl")
+
list<Namespace*>::iterator itCurrNamespaceDecl= m_namespaceDecls.begin();
while(itCurrNamespaceDecl != m_namespaceDecls.end())
@@ -445,33 +489,41 @@
itCurrNamespaceDecl++;
}
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-BasicNode* HeaderBlock::getLastChild()
+BasicNode* HeaderBlock::
+getLastChild()
{
+ logEntryEngine("HeaderBlock::getLastChild")
+
+ BasicNode* returnPtr = NULL;
+
list<BasicNode*>::reverse_iterator ritCurrBasicNode= m_children.rbegin();
- if (ritCurrBasicNode != m_children.rend())
- {
- return (*ritCurrBasicNode);
- }
+ if (ritCurrBasicNode != m_children.rend())
+ returnPtr = *ritCurrBasicNode;
+
+ logExitWithPointer(returnPtr)
- return NULL;
+ return returnPtr;
}
-BasicNode* HeaderBlock::getChild(int iChildPosition)
+BasicNode* HeaderBlock::
+getChild(int iChildPosition)
{
+ logEntryEngine("HeaderBlock::getChild")
+
+ BasicNode* returnPtr = NULL;
+
if ( (iChildPosition<=0) || (iChildPosition > iNoOFChildren) )
- {
- return NULL;
- }
+ returnPtr = NULL;
else
{
list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
- /* The following is done since the previous line already takes the
- * iterator one step forward
- */
+ // following is done since the previous line already takes the iterator one step forward
iChildPosition--;
/* Takes the iterator to the relavent positon */
@@ -481,33 +533,33 @@
}
if (itCurrBasicNode != m_children.end())
- {
- return *itCurrBasicNode;
- }
- else
- {
- return NULL;
- }
+ returnPtr = *itCurrBasicNode;
}
+
+ logExitWithPointer(returnPtr)
+
+ return returnPtr;
}
-BasicNode* HeaderBlock::createChild(NODE_TYPE eNODE_TYPE)
+BasicNode* HeaderBlock::
+createChild(NODE_TYPE eNODE_TYPE)
{
+ logEntryEngine("HeaderBlock::createChild")
+
BasicNode* pBasicNode = NULL;
if(eNODE_TYPE==CHARACTER_NODE)
- {
pBasicNode = new CharacterElement();
- }
else if (eNODE_TYPE==ELEMENT_NODE)
- {
pBasicNode = new ComplexElement();
- }
+
+ logExitWithPointer(pBasicNode)
return pBasicNode;
}
-bool HeaderBlock::operator ==( const HeaderBlock &objHeaderBlock)
+bool HeaderBlock::
+operator ==( const HeaderBlock &objHeaderBlock)
{
/*
* TODO : the logic
@@ -538,30 +590,28 @@
const AxisChar * pURI,
const AxisChar * pValue)
{
-// Check that the contents of the passed parameters are valid.
+ logEntryEngine("HeaderBlock::createAttribute")
+
+ // Check that the contents of the passed parameters are valid.
if( NULL == pLocalName || 0 == strlen( pLocalName))
{
+ logExitWithPointer(NULL)
+
return NULL;
}
if( !pPrefix)
- {
pPrefix = "";
- }
if( !pURI)
- {
pURI = "";
- }
if( !pValue)
- {
pValue = "";
- }
-// Check that the local name and prefix have not already been defined. If
-// they have, then return NULL indicating that the prefix/localname pair have
-// already been defined.
+ // Check that the local name and prefix have not already been defined. If
+ // they have, then return NULL indicating that the prefix/localname pair have
+ // already been defined.
list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
while( itCurrAttribute != m_attributes.end())
@@ -569,6 +619,8 @@
if( (strcmp( (*itCurrAttribute)->getLocalName(), pLocalName) == 0) &&
(strcmp( (*itCurrAttribute)->getPrefix(), pPrefix) == 0))
{
+ logExitWithPointer(NULL)
+
return NULL;
}
else
@@ -577,11 +629,11 @@
}
}
-// Check that the prefix has not already been defined in the namespace
-// declarations. If it has, then return NULL indicating that the
-// prefix/localname pair has already been defined and 'copy down' the
-// namespace decl into the attribute list as this will help in the
-// serialisation.
+ // Check that the prefix has not already been defined in the namespace
+ // declarations. If it has, then return NULL indicating that the
+ // prefix/localname pair has already been defined and 'copy down' the
+ // namespace decl into the attribute list as this will help in the
+ // serialisation.
list<Namespace*>::iterator itCurrNamespaceDecls = m_namespaceDecls.begin();
while( itCurrNamespaceDecls != m_namespaceDecls.end())
@@ -595,6 +647,8 @@
m_attributes.push_back( pAttribute);
+ logExitWithPointer(pAttribute)
+
return pAttribute;
}
else
@@ -603,19 +657,22 @@
}
}
-// If the prefix/localname pair have not previously been defined, then create
-// and return the attribute.
+ // If the prefix/localname pair have not previously been defined, then create
+ // and return the attribute.
Attribute * pAttribute = new Attribute( m_attributes, pLocalName, pPrefix, pURI, pValue);
m_attributes.push_back( pAttribute);
+ logExitWithPointer(pAttribute)
+
return pAttribute;
}
-IAttribute* HeaderBlock::createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE
- eStdAttrType,
- SOAP_VERSION eSOAP_VERSION)
+IAttribute* HeaderBlock::
+createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, SOAP_VERSION eSOAP_VERSION)
{
+ logEntryEngine("HeaderBlock::createStdAttribute")
+
Attribute* pAttribute = NULL;
bool blnStatus = true;
@@ -693,44 +750,53 @@
if (blnStatus)
{
- // Samisa: AXISCPP-452 - got to check for duplicate attributes
+ // got to check for duplicate attributes
list<Attribute*>::iterator itAttr = m_attributes.begin();
while (itAttr != m_attributes.end())
{
Attribute* pCurrentAttribute = *itAttr;
if (!strcmp(pCurrentAttribute->getLocalName(),pAttribute->getLocalName() ) &&
!strcmp(pCurrentAttribute->getPrefix(), pAttribute->getPrefix() ) )
- {
- // we have the attribute set already, so only change the value
- pCurrentAttribute->setValue( pAttribute->getValue() );
- delete pAttribute;
- return pCurrentAttribute; // return the currently set attributes pointer
- // job done
- }
+ {
+ // we have the attribute set already, so only change the value
+ pCurrentAttribute->setValue( pAttribute->getValue() );
+ delete pAttribute;
+
+ logExitWithPointer(pCurrentAttribute)
+
+ return pCurrentAttribute;
+ }
+
itAttr++;
}
// we do not have the attribute set already, hence add it
m_attributes.push_back(pAttribute);
+
+ logExitWithPointer(pAttribute)
+
return pAttribute;
}
else
{
+ logExitWithPointer(NULL)
+
return NULL;
}
}
-const AxisChar* HeaderBlock::getAttributeValue(const AxisChar *localname,
- const AxisChar *prefix)
+const AxisChar* HeaderBlock::
+getAttributeValue(const AxisChar *localname, const AxisChar *prefix)
{
+ logEntryEngine("HeaderBlock::getAttributeValue")
+
+ const AxisChar* returnValue = NULL;
+
if(!localname)
- {
localname="";
- }
+
if(!prefix)
- {
prefix="";
- }
list<Attribute*>::iterator itAttr = m_attributes.begin();
while (itAttr != m_attributes.end())
@@ -739,16 +805,24 @@
if (!strcmp(pAttribute->getLocalName(),localname) &&
!strcmp(pAttribute->getPrefix(),prefix))
{
- return pAttribute->getValue();
+ returnValue = pAttribute->getValue();
+ break;
}
itAttr++;
}
- return NULL;
+
+ logExitWithString(returnValue)
+
+ return returnValue;
}
-const AxisChar * HeaderBlock::getAttributeUri( const AxisChar * localname,
- const AxisChar * prefix)
+const AxisChar * HeaderBlock::
+getAttributeUri( const AxisChar * localname, const AxisChar * prefix)
{
+ logEntryEngine("HeaderBlock::getAttributeUri")
+
+ const AxisChar* returnValue = NULL;
+
list<Attribute*>::iterator itAttr = m_attributes.begin();
while( itAttr != m_attributes.end())
@@ -758,120 +832,100 @@
if( !strcmp( pAttribute->getLocalName(),localname) &&
!strcmp( pAttribute->getPrefix(),prefix))
{
- return pAttribute->getURI();
+ returnValue = pAttribute->getURI();
+ break;
}
- if( strlen( localname) == 0 &&
- !strcmp( pAttribute->getPrefix(), prefix))
+ if( strlen( localname) == 0 && !strcmp( pAttribute->getPrefix(), prefix))
{
- return pAttribute->getURI();
+ returnValue = pAttribute->getURI();
+ break;
}
itAttr++;
}
- return NULL;
+ logExitWithString(returnValue)
+
+ return returnValue;
}
-BasicNode* HeaderBlock::createImmediateChild(NODE_TYPE eNODE_TYPE,
- AxisChar *pachLocalName,
- AxisChar *pachPrefix,
- AxisChar *pachUri,
- AxisChar* pachValue)
+BasicNode* HeaderBlock::
+createImmediateChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue)
{
+ logEntryEngine("HeaderBlock::createImmediateChild")
+
BasicNode* pBasicNode = NULL;
if(!pachLocalName)
- {
pachLocalName="";
- }
+
if(!pachPrefix)
- {
pachPrefix="";
- }
+
if(!pachUri)
- {
pachUri="";
- }
+
if(!pachValue)
- {
pachValue="";
- }
-
do
{
-
if(eNODE_TYPE==CHARACTER_NODE)
- {
pBasicNode = new CharacterElement(pachValue);
- }
else if (eNODE_TYPE==ELEMENT_NODE)
{
if ( (pachLocalName) && (pachUri) )
- {
- pBasicNode = new ComplexElement(pachLocalName, pachPrefix,
- pachUri);
- }
+ pBasicNode = new ComplexElement(pachLocalName, pachPrefix, pachUri);
else
- {
break;
- }
}
else
- {
break;
- }
if (pBasicNode)
{
m_children.push_back(pBasicNode);
iNoOFChildren++;
}
- } while (0);
+ }
+ while (0);
+ logExitWithPointer(pBasicNode)
+
return pBasicNode;
}
-BasicNode* HeaderBlock::createChild(NODE_TYPE eNODE_TYPE,
- AxisChar *pachLocalName,
- AxisChar *pachPrefix,
- AxisChar *pachUri,
- AxisChar *pachValue)
+BasicNode* HeaderBlock::
+createChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName,
+ AxisChar *pachPrefix, AxisChar *pachUri, AxisChar *pachValue)
{
+ logEntryEngine("HeaderBlock::createChild")
+
BasicNode* pBasicNode = NULL;
if(!pachLocalName)
- {
pachLocalName="";
- }
+
if(!pachPrefix)
- {
pachPrefix="";
- }
+
if(!pachUri)
- {
pachUri="";
- }
+
if(!pachValue)
- {
pachValue="";
- }
do
{
if(eNODE_TYPE==CHARACTER_NODE)
- {
pBasicNode = new CharacterElement(pachValue);
- }
else if (eNODE_TYPE==ELEMENT_NODE)
- {
- pBasicNode = new ComplexElement(pachLocalName, pachPrefix,
- pachUri);
- }
+ pBasicNode = new ComplexElement(pachLocalName, pachPrefix, pachUri);
else
- {
break;
- }
- } while (0);
+ }
+ while (0);
+
+ logExitWithPointer(pBasicNode)
return pBasicNode;
}
@@ -881,24 +935,25 @@
return iNoOFChildren;
}
-BasicNode* HeaderBlock::getFirstChild()
+BasicNode* HeaderBlock::
+getFirstChild()
{
+ logEntryEngine("HeaderBlock::getFirstChild")
+
+ BasicNode* returnValue = NULL;
+
list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
if (itCurrBasicNode != m_children.end())
{
- return (*itCurrBasicNode);
+ returnValue = (*itCurrBasicNode);
}
- return NULL;
-}
+ logExitWithPointer(returnValue)
-HeaderBlock::HeaderBlock(const AxisChar *pachLocalName, const AxisChar *pachUri, const AxisChar *pachPrefix)
-{
- iNoOFChildren = 0;
- m_localname = pachLocalName;
- m_uri = pachUri;
- m_sPrefix = pachPrefix;
+ return returnValue;
}
+
+
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/soap/SoapBody.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapBody.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapBody.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapBody.cpp Thu Nov 13 14:13:23 2008
@@ -29,33 +29,53 @@
extern SoapEnvVersionsStruct gs_SoapEnvVersionsStruct[VERSION_LAST];
-SoapBody::SoapBody()
+SoapBody::
+SoapBody()
{
+ logEntryEngine("SoapBody::SoapBody")
+
m_pSoapMethod= NULL;
m_pSoapFault= NULL;
+
+ logExit()
}
-SoapBody::~SoapBody()
+SoapBody::
+~SoapBody()
{
- if(m_pSoapMethod)
- delete m_pSoapMethod;
+ logEntryEngine("SoapBody::~SoapBody")
- if(m_pSoapFault)
- delete m_pSoapFault;
+ delete m_pSoapMethod;
+ delete m_pSoapFault;
+
+ logExit()
}
-void SoapBody::setSoapMethod(SoapMethod* ptrSoapMethod)
+void SoapBody::
+setSoapMethod(SoapMethod* ptrSoapMethod)
{
+ logEntryEngine("SoapBody::setSoapMethod")
+
m_pSoapMethod= ptrSoapMethod;
+
+ logExit()
}
-void SoapBody::setSoapFault(SoapFault *pSoapFault)
+void SoapBody::
+setSoapFault(SoapFault *pSoapFault)
{
+ logEntryEngine("SoapBody::setSoapFault")
+
m_pSoapFault= pSoapFault;
+
+ logExit()
}
-int SoapBody::serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
+int SoapBody::
+serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
{
+ logEntryEngine("SoapBody::serialize")
+
int iStatus= AXIS_SUCCESS;
do
@@ -101,31 +121,43 @@
pSZ.serialize("</", gs_SoapEnvVersionsStruct[eSoapVersion].pchPrefix,
":", gs_SoapEnvVersionsStruct[eSoapVersion].pchWords[SKW_BODY],
">\n", NULL);
- } while(0);
+ }
+ while(0);
+
+ logExitWithReturnCode(iStatus)
return iStatus;
}
-void SoapBody::addAttribute(Attribute *attr)
+void SoapBody::
+addAttribute(Attribute *attr)
{
+ logEntryEngine("SoapBody::addAttribute")
+
m_attributes.push_back(attr);
+
+ logExit()
}
-int SoapBody::serializeAttributes(SoapSerializer& pSZ)
+int SoapBody::
+serializeAttributes(SoapSerializer& pSZ)
{
+ logEntryEngine("SoapBody::serializeAttributes")
+
int iStatus= AXIS_SUCCESS;
list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
while(itCurrAttribute != m_attributes.end())
{
-
iStatus= (*itCurrAttribute)->serialize(pSZ);
if(iStatus==AXIS_FAIL)
break;
itCurrAttribute++;
}
+ logExitWithReturnCode(iStatus)
+
return iStatus;
}