axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r713841 [4/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...
Date Thu, 13 Nov 2008 22:13:25 GMT
Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Thu Nov 13 14:13:23 2008
@@ -63,6 +63,8 @@
 SoapDeSerializer::
 SoapDeSerializer ()
 {
+	logEntryEngine("SoapDeSerializer::SoapDeSerializer")
+
     m_pParser = XMLParserFactory::getParserObject ();
     m_pEnv = NULL;
     m_pHeader = NULL;
@@ -71,27 +73,40 @@
     m_pInputStream = NULL;
     m_nStatus = AXIS_SUCCESS;
     m_nSoapVersion = VERSION_LAST;
+    
+	logExit()
 }
 
 SoapDeSerializer::
 ~SoapDeSerializer ()
 {
+	logEntryEngine("SoapDeSerializer::~SoapDeSerializer")
+
     delete m_pEnv;
     delete m_pHeader;
     if (m_pParser)
         XMLParserFactory::destroyParserObject (m_pParser);
     delete pBodyContent;
+    
+    logExit()
 }
 
 int SoapDeSerializer::
 setInputStream (SOAPTransport * pInputStream)
 {
-    if (NULL == pInputStream)
-        return AXIS_FAIL;
-
-    m_pInputStream = pInputStream;
+	logEntryEngine("SoapDeSerializer::setInputStream")
 
-    return m_pParser->setInputStream (pInputStream);
+	int iStatus = AXIS_FAIL;
+	
+    if (NULL != pInputStream)
+    {
+    	m_pInputStream = pInputStream;
+    	iStatus        = m_pParser->setInputStream (pInputStream);
+    }
+    
+    logExitWithReturnCode(iStatus)
+    
+    return iStatus;
 }
 
 /*
@@ -100,6 +115,8 @@
 void SoapDeSerializer::
 throwParserException()
 {
+	logEntryEngine("SoapDeSerializer::throwParserException")
+
     AxisParseException e;
     
     if (m_pParser->getStatus() != AXIS_SUCCESS)
@@ -107,6 +124,8 @@
     else
         e.setMessage(SERVER_PARSE_PARSER_FAILED, "AxisParseException:");
         
+    logThrowExceptionWithData("AxisParseException", e.what())
+    
     throw e;
 }
 
@@ -118,38 +137,51 @@
 int SoapDeSerializer::
 getNextNode(bool ifNotSet, bool characterMode, bool throwExcOnError)
 {
+	logSetFunctionNameEngine("SoapDeSerializer::getNextNode")
+	
+	int iStatus = AXIS_FAIL;
+
     // If node pointer is set and user requested that we 
     // only get next element if not set, return.
     if (ifNotSet && m_pNode)
-        return AXIS_SUCCESS;
-    
-    // Ensure m_pNode is NULL before calling parser in case of exceptions.
-    m_pNode = NULL;
-    
-    // Just a sanity check
-    if (!m_pParser)
-        return AXIS_FAIL;       
-    
-    try
-    { 
-        m_pNode = m_pParser->next(characterMode);
-    }
-    catch (AxisException &e)
+        iStatus = AXIS_SUCCESS;
+    else
     {
-        // Exception processing will be handled in subsequent code
+	    // Ensure m_pNode is NULL before calling parser in case of exceptions.
+	    m_pNode = NULL;
+	    
+	    // Just a sanity check
+	    if (m_pParser)
+		{
+		    try
+		    { 
+		        m_pNode = m_pParser->next(characterMode);
+		    }
+		    catch (AxisException &e)
+		    {
+		        // Exception processing will be handled in subsequent code
+		    }
+		    
+		    // If no node obtained, either there is no more data to read (at this time
+		    // we treat this as an error but we do not throw an exception for this) or the 
+		    // parser had an exception, in which case we throw an exception if requested.
+		    if (!m_pNode)
+		    {
+		        m_nStatus = AXIS_FAIL;
+		        if (throwExcOnError && (AXIS_FAIL == m_pParser->getStatus()))
+		            throwParserException();
+		    }
+		    else
+		    	iStatus = AXIS_SUCCESS;
+	    }
     }
     
-    // If no node obtained, either there is no more data to read (at this time
-    // we treat this as an error but we do not throw an exception for this) or the 
-    // parser had an exception, in which case we throw an exception if requested.
-    if (!m_pNode)
+    if (AXIS_SUCCESS != iStatus)
     {
-        m_nStatus = AXIS_FAIL;
-        if (throwExcOnError && (AXIS_FAIL == m_pParser->getStatus()))
-            throwParserException();
+    	logDebug("Status being returned is AXIS_FAIL")
     }
-    
-    return m_pNode ? AXIS_SUCCESS : AXIS_FAIL;
+
+    return iStatus;
 }
 
 
@@ -159,6 +191,8 @@
 int SoapDeSerializer::
 skipNode(bool verifyIfEndNode, bool throwExcOnError)
 {
+	logEntryEngine("SoapDeSerializer::skipNode")
+
     int rc = getNextNode(false, false, throwExcOnError);
     
     if (rc == AXIS_SUCCESS)
@@ -175,19 +209,30 @@
         m_pNode = NULL;
     }
     
+	logExitWithReturnCode(rc)
+
     return rc;
 }
 
 SoapEnvelope *SoapDeSerializer::
 getEnvelope ()
 {
-    if (AXIS_FAIL == getNextNode(true))     
+	logEntryEngine("SoapDeSerializer::getEnvelope")
+
+    if (AXIS_FAIL == getNextNode(true))  
+    {
+        logExitWithPointer(NULL)
+
         return NULL;
+    }
             
     // Better be a start-element.
     if (START_ELEMENT != m_pNode->m_type)
     {
         m_nStatus = AXIS_FAIL;
+        
+    	logThrowExceptionWithData("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR", "Start-element for SOAP Envelope not found.")
+
         throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Start-element for SOAP Envelope not found.");
     }
             
@@ -195,6 +240,9 @@
     if (0 != strcmp(m_pNode->m_pchNameOrValue,SoapKeywordMapping::map(SOAP_VER_1_2).pchWords[SKW_ENVELOPE]))
     {
         m_nStatus = AXIS_FAIL;
+        
+    	logThrowExceptionWithData("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR", "Element is not a SOAP Envelope.")
+
         throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Element is not a SOAP Envelope.");
     }
     
@@ -228,6 +276,9 @@
 
     // indicate node consumed and return envelope
     m_pNode = NULL;  
+    
+    logExitWithPointer(m_pEnvl)
+    
     return m_pEnvl;
 }
 
@@ -240,26 +291,33 @@
 IHeaderBlock *SoapDeSerializer::
 getHeaderBlock (const AxisChar * pName, const AxisChar * pNamespace)
 {
-    // if no <Header> element there can be no Header blocks 
-    if (!m_pHeader)
-        return NULL; 
+	logEntryEngine("SoapDeSerializer::getHeaderBlock")
 
-    return m_pHeader->getHeaderBlock (pName, pNamespace, true);
+    IHeaderBlock * returnValue = NULL;
+	
+    if (m_pHeader)
+    	returnValue = m_pHeader->getHeaderBlock (pName, pNamespace, true);
+    
+    logExitWithPointer(returnValue)
+
+    return returnValue;
 }
 
 int SoapDeSerializer::
 getHeader ()
 {
-    if (m_pHeader)
-        return m_nStatus;
+	logEntryEngine("SoapDeSerializer::getHeader")
+
+    if (m_pHeader || AXIS_FAIL == getNextNode())
+    {
+    	logExitWithReturnCode(m_nStatus)
 
-    if (AXIS_FAIL == getNextNode())       
         return m_nStatus;
+    }
 
     if ((START_ELEMENT == m_pNode->m_type) 
             && (m_nSoapVersion != VERSION_LAST)
-            && (0 == strcmp (m_pNode->m_pchNameOrValue,
-                             SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
+            && (0 == strcmp (m_pNode->m_pchNameOrValue,SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
     {
         delete m_pHeader;
         m_pHeader = new SoapHeader ();
@@ -268,14 +326,13 @@
         while (true)
         {
             if (AXIS_FAIL == getNextNode(false, true, false))       
-                return m_nStatus;
+                break;
     
             if ((END_ELEMENT == m_pNode->m_type) &&
-                (0 == strcmp (m_pNode->m_pchNameOrValue,
-                              SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
+                (0 == strcmp (m_pNode->m_pchNameOrValue,SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
             {
                 m_pNode = NULL; // indicate node consumed
-                return m_nStatus;
+                break;
             }
     
             // following is done to ignore anything (eg : the toplevel whitespaces) but a start element.
@@ -375,6 +432,8 @@
         }
     }
 
+	logExitWithReturnCode(m_nStatus)
+
     return m_nStatus;
 }
 
@@ -382,38 +441,47 @@
 const char*SoapDeSerializer::
 peekNextElementName ()
 { 
+	logEntryEngine("SoapDeSerializer::peekNextElementName")
+
+    const char*name = NULL;
+	
     if (m_pParser)
-    {
-        const char* name = m_pParser->peek ();
-        return name;
-    }
+        name = m_pParser->peek ();
             
-    return NULL;
+	logExitWithString(name)
+
+    return name;
 }
 
 int SoapDeSerializer::
 getBody ()
 {
-    if (AXIS_FAIL == getNextNode(true))
-        return m_nStatus;
+	logEntryEngine("SoapDeSerializer::getBody")
 
-    // previous header searching may have left a node unidentified
-    if ((START_ELEMENT == m_pNode->m_type) 
-            && (m_nSoapVersion != VERSION_LAST)
-            && (0 == strcmp (m_pNode->m_pchNameOrValue,
-                             SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY])))
+	int iStatus = AXIS_FAIL;
+	
+    if (AXIS_FAIL == getNextNode(true))
+    	iStatus = m_nStatus;
+    else
     {
-        // indicate node consumed
-        m_pNode = NULL; 
-
-        // peek for the method name
-        m_strMethodNameToInvoke = m_pParser->peek();
-        
-        return AXIS_SUCCESS;
+	    // previous header searching may have left a node unidentified
+	    if ((START_ELEMENT == m_pNode->m_type) 
+	            && (m_nSoapVersion != VERSION_LAST)
+	            && (0 == strcmp (m_pNode->m_pchNameOrValue,SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY])))
+	    {
+	        // indicate node consumed
+	        m_pNode = NULL; 
+	
+	        // peek for the method name
+	        m_strMethodNameToInvoke = m_pParser->peek();
+	        
+	        iStatus = AXIS_SUCCESS;
+	    }
     }
 
-    m_nStatus = AXIS_FAIL;
-    return AXIS_FAIL;
+	logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 
 int SoapDeSerializer::
@@ -425,55 +493,89 @@
 int SoapDeSerializer::
 validateMessageBody(const AxisChar * pName, const AxisChar * pNamespace, bool consumeIt)
 {
-    // Will throw exception if failure in parser
-    if (AXIS_FAIL == getNextNode(true))
-        return AXIS_FAIL;
-        
-    if (START_ELEMENT != m_pNode->m_type)
-        throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Start-element was not found.");
+	logEntryEngine("SoapDeSerializer::validateMessageBody")
 
-    // If a fault has occurred or the node name is unexpected, throw exception
-    // deserialize it as doc literal by setting style. 
-    if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
+	int iStatus = AXIS_FAIL;
+	
+    // Will throw exception if failure in parser
+    if (AXIS_FAIL != getNextNode(true))
     {
-        setStyle (DOC_LITERAL);
-        AXISTRACE1 ("AXISC_NODE_VALUE_MISMATCH_EXCEPTION", CRITICAL);
-        throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
-    }
+	    if (START_ELEMENT != m_pNode->m_type)
+	    {
+	    	logThrowExceptionWithData("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR", "Start-element was not found.")
 
-    // indicate node consumed
-    if (consumeIt)
-    	m_pNode = NULL; 
+	        throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Start-element was not found.");
+	    }
+	
+	    // If a fault has occurred or the node name is unexpected, throw exception
+	    // deserialize it as doc literal by setting style. 
+	    if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
+	    {
+	        setStyle (DOC_LITERAL);
+	        
+	        logThrowException("AxisGenException - AXISC_NODE_VALUE_MISMATCH_EXCEPTION")
+	        		
+	        throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
+	    }
+	
+	    // indicate node consumed
+	    if (consumeIt)
+	    	m_pNode = NULL; 
+	    
+	    iStatus = AXIS_SUCCESS;
+    }
     
-    return AXIS_SUCCESS;
+	logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 
 // Used for one-way message processing, to initiate a fault.
 void SoapDeSerializer::
 initiateFault (const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapDeSerializer::initiateFault")
+
     // Will throw exception if failure in parser
-    if (AXIS_FAIL == getNextNode(true))
-        return;
-        
-    if (START_ELEMENT != m_pNode->m_type)
-        throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Start-element was not found.");
+    if (AXIS_FAIL != getNextNode(true))
+    {
+	    if (START_ELEMENT != m_pNode->m_type)
+	    {
+	    	logThrowExceptionWithData("AxisSoapException - CLIENT_SOAP_SOAP_CONTENT_ERROR", "Start-element was not found.")
+	    	
+	        throw AxisSoapException (CLIENT_SOAP_SOAP_CONTENT_ERROR, "Start-element was not found.");
+	    }
+	
+	    setStyle (DOC_LITERAL);
+	    
+        logThrowException("AxisGenException - AXISC_NODE_VALUE_MISMATCH_EXCEPTION")
 
-    setStyle (DOC_LITERAL);
-    throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);    
+	    throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION); 
+    }
+	
+	logExit()
 }
 
 void *SoapDeSerializer::
 checkForFault (const AxisChar * pName, const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapDeSerializer::checkForFault")
+
     if (0 != strcmp ("Fault", pName))
+    {
+        logThrowExceptionWithData("AxisGenException - AXISC_NODE_VALUE_MISMATCH_EXCEPTION", "Fault element name not valid.")
+
         throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION, 
                                 "Fault element name not valid.");
+    }
         
     if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
     {
         m_nStatus = AXIS_SUCCESS;
         m_pNode = NULL;
+        
+        logThrowException("AxisGenException - AXISC_NODE_VALUE_MISMATCH_EXCEPTION")
+
         throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
     }
 
@@ -549,16 +651,23 @@
         delete [] pcDetail;
         delete pFault;
         
+        logRethrowException()
+        
         throw;
     }
 
     setStyle (m_nStyle);
+    
+    logExitWithPointer(pFault)
+    
     return pFault;
 }
 
 int SoapDeSerializer::
 init ()
 {
+	logEntryEngine("SoapDeSerializer::init")
+
     m_pNode = NULL;
     m_pCurrNode = NULL;
 
@@ -571,12 +680,16 @@
     m_nSoapVersion = VERSION_LAST;
     m_nStatus = AXIS_SUCCESS;
 
+	logExitWithReturnCode(m_nStatus)
+
     return m_nStatus;
 }
 
 int SoapDeSerializer::
 getVersion ()
 {
+	logEntryEngine("SoapDeSerializer::getVersion")
+
     if (VERSION_LAST == m_nSoapVersion)
     {
         delete m_pEnv;
@@ -584,6 +697,8 @@
         m_pEnv = getEnvelope ();
     }
 
+	logExitWithInteger(m_nSoapVersion)
+	
     return m_nSoapVersion;
 }
 
@@ -595,11 +710,17 @@
 int SoapDeSerializer::
 getArraySize ()
 {
+	logEntryEngine("SoapDeSerializer::getArraySize")
+
     int nSize = 0;
     
     // If not RPC or failure in getNextNode, return zero.
     if (RPC_ENCODED != m_nStyle || (AXIS_FAIL == getNextNode()))
-      return nSize;
+    {
+    	logExitWithInteger(nSize)
+
+    	return nSize;
+    }
     
     // first check whether this is a start element node
     if (START_ELEMENT == m_pNode->m_type)
@@ -608,11 +729,18 @@
         if (START_END_ELEMENT == m_pNode->m_type2)
         {
             skipNode();
+            
+        	logExitWithInteger(nSize)
+
             return nSize;
         }
     }
     else if (END_ELEMENT == m_pNode->m_type)
+    {
+    	logExitWithInteger(nSize)
+
         return nSize;
+    }
 
     for (int i = 0; m_pNode->m_pchAttributes[i]; i += 3)
     {
@@ -629,10 +757,14 @@
             if (nSize == 0)
                 skipNode();
                 
+        	logExitWithInteger(nSize)
+
             return nSize;
         }
     }
 
+	logExitWithInteger(nSize)
+
     return nSize;
 }
 
@@ -656,35 +788,39 @@
                void *pDZFunct, void *pCreFunct, void *pDelFunct, 
                const AxisChar * pName, const AxisChar * pNamespace)
 {
-    // if anything has gone wrong earlier just do nothing 
-    if (AXIS_SUCCESS != m_nStatus)
-        return pArray;
+	logEntryEngine("SoapDeSerializer::getCmplxArray")
 
-    // Loop through the array adding elements.
-    int arraySize = getArraySize ();    
-    int count = 0;
-    const char* elementName;
-    
-    while(RPC_ENCODED != m_nStyle || count < arraySize)
-    {
-        // For RPC-encoded arrays, the element name in array cannot be derived - 
-        // within an array value element names are not significant - so  
-        // we read until end-of-element is encountered (i.e. null string 
-        // is returned from peek()). 
-        elementName = m_pParser->peek();
-        if ((RPC_ENCODED == m_nStyle && 0x00 != *elementName) || strcmp(elementName, pName) == 0)
-            pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
-        else
-            break;    
-            
-        ++count;    
+    // if anything has gone wrong earlier just do nothing 
+    if (AXIS_SUCCESS == m_nStatus)
+    {
+	    // Loop through the array adding elements.
+	    int arraySize = getArraySize ();    
+	    int count = 0;
+	    const char* elementName;
+	    
+	    while(RPC_ENCODED != m_nStyle || count < arraySize)
+	    {
+	        // For RPC-encoded arrays, the element name in array cannot be derived - 
+	        // within an array value element names are not significant - so  
+	        // we read until end-of-element is encountered (i.e. null string 
+	        // is returned from peek()). 
+	        elementName = m_pParser->peek();
+	        if ((RPC_ENCODED == m_nStyle && 0x00 != *elementName) || strcmp(elementName, pName) == 0)
+	            pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
+	        else
+	            break;    
+	            
+	        ++count;    
+	    }
+	    
+	    if (AXIS_FAIL == m_nStatus) // TODO - not sure this line is needed
+	        m_pNode = NULL;         // TODO - not sure this line is needed
+	    else if (arraySize > 0)
+	        skipNode();
     }
-    
-    if (AXIS_FAIL == m_nStatus) // TODO - not sure this line is needed
-        m_pNode = NULL;         // TODO - not sure this line is needed
-    else if (arraySize > 0)
-        skipNode();
         
+	logExitWithPointer(pArray)
+
     return pArray;
 }
 
@@ -706,79 +842,85 @@
 Axis_Array*SoapDeSerializer::
 getBasicArray (XSDTYPE nType, const AxisChar * pName, const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapDeSerializer::getBasicArray")
+
     int size = 0;      
     Axis_Array* Array = new Axis_Array();
     Array->m_Type = nType;
 
     // if anything has gone wrong earlier just do nothing
-    if (AXIS_SUCCESS != m_nStatus)
-        return Array;
-
-    // Loop through the array adding elements.
-    IAnySimpleType* pSimpleType = NULL;
-    void * pValue = NULL;
-    
-    try
+    if (AXIS_SUCCESS == m_nStatus)
     {
-        size = getArraySize ();
-        const char* elementName;
-        int count = 0;
-                
-        while(RPC_ENCODED != m_nStyle || count < size)
-        {
-            // For RPC-encoded arrays, the element name in array cannot be derived - 
-            // within an array value element names are not significant -   
-            // so we read until end-of-element is encountered (i.e. null string 
-            // is returned from peek()). 
-            elementName = m_pParser->peek();
-            if ((RPC_ENCODED == m_nStyle && 0x00 != *elementName) || strcmp(elementName, pName) == 0)
-            {
-            	// TODO instead of deleting the pointer use it by by-passing addElement().
-            	if (XSD_ANYTYPE != nType)
-            	{
-	                if (0 == count)
-	                    pSimpleType = AxisUtils::createSimpleTypeObject(nType);
-	                getElement(pName, pNamespace, pSimpleType, (bool)(RPC_ENCODED == m_nStyle));
-	                pValue = pSimpleType->getValue();
-	                Array->addElement(pValue);
+	    // Loop through the array adding elements.
+	    IAnySimpleType* pSimpleType = NULL;
+	    void * pValue = NULL;
+	    
+	    try
+	    {
+	        size = getArraySize ();
+	        const char* elementName;
+	        int count = 0;
+	                
+	        while(RPC_ENCODED != m_nStyle || count < size)
+	        {
+	            // For RPC-encoded arrays, the element name in array cannot be derived - 
+	            // within an array value element names are not significant -   
+	            // so we read until end-of-element is encountered (i.e. null string 
+	            // is returned from peek()). 
+	            elementName = m_pParser->peek();
+	            if ((RPC_ENCODED == m_nStyle && 0x00 != *elementName) || strcmp(elementName, pName) == 0)
+	            {
+	            	// TODO instead of deleting the pointer use it by by-passing addElement().
+	            	if (XSD_ANYTYPE != nType)
+	            	{
+		                if (0 == count)
+		                    pSimpleType = AxisUtils::createSimpleTypeObject(nType);
+		                getElement(pName, pNamespace, pSimpleType, (bool)(RPC_ENCODED == m_nStyle));
+		                pValue = pSimpleType->getValue();
+		                Array->addElement(pValue);
+		                Axis::AxisDelete(pValue, pSimpleType->getType());
+	            	}
+	            	else
+	            	{
+	            		pValue = getElementAsAnyType(pName, pNamespace);
+	            		Array->addElement(pValue);
+	            		Axis::AxisDelete(pValue, XSD_ANYTYPE);
+	            	}
+	            	
+	                pValue = NULL;
+	            }
+	            else
+	                break;
+	                
+	            ++count;
+	        }             
+	    }
+	    catch ( ... )
+	    {
+	        if (pSimpleType)
+	        { 
+	            if (pValue)
 	                Axis::AxisDelete(pValue, pSimpleType->getType());
-            	}
-            	else
-            	{
-            		pValue = getElementAsAnyType(pName, pNamespace);
-            		Array->addElement(pValue);
-            		Axis::AxisDelete(pValue, XSD_ANYTYPE);
-            	}
-            	
-                pValue = NULL;
-            }
-            else
-                break;
-                
-            ++count;
-        }             
-    }
-    catch ( ... )
-    {
-        if (pSimpleType)
-        { 
-            if (pValue)
-                Axis::AxisDelete(pValue, pSimpleType->getType());
-            delete pSimpleType;
-        }
-        
-        delete Array;
-        
-        throw;
+	            delete pSimpleType;
+	        }
+	        
+	        delete Array;
+	        
+	        logRethrowException()
+	        
+	        throw;
+	    }
+	    
+	    delete pSimpleType;
+	    
+	    if (AXIS_FAIL == m_nStatus) // TODO - not sure this line is needed
+	        m_pNode = NULL;         // TODO - not sure this line is needed
+	    else if (size > 0)
+	        skipNode();
     }
     
-    delete pSimpleType;
-    
-    if (AXIS_FAIL == m_nStatus) // TODO - not sure this line is needed
-        m_pNode = NULL;         // TODO - not sure this line is needed
-    else if (size > 0)
-        skipNode();
-                
+	logExitWithPointer(Array)
+
     return Array;    
 }
 
@@ -801,13 +943,16 @@
 getCmplxObject (void *pDZFunct, void *pCreFunct, void *pDelFunct, 
                 const AxisChar * pName, const AxisChar * pNamespace, bool isFault)
 {
+	logEntryEngine("SoapDeSerializer::getCmplxObject")
+
     if (!isFault)
     {
-        if (AXIS_SUCCESS != m_nStatus)
-            return NULL;
-    
-        if (AXIS_FAIL == getNextNode(RPC_ENCODED != m_nStyle))
+        if (AXIS_SUCCESS != m_nStatus || (AXIS_FAIL == getNextNode(RPC_ENCODED != m_nStyle)))
+        {
+        	logExitWithPointer(NULL)
+
             return NULL;  
+        }
     }
     
     if (RPC_ENCODED != m_nStyle) // TODO - why do we selectively do this check and not for all?
@@ -819,6 +964,8 @@
              * null value or none filled value. Some Web services servers work
              * like this. This apply for all the rest of the deserializer.
              */
+        	logExitWithPointer(NULL)
+
             return NULL;            
         }
     
@@ -831,6 +978,9 @@
     if (isNilValue())
     {
         skipNode();
+        
+    	logExitWithPointer(NULL)
+
         return NULL;
     }
     
@@ -843,59 +993,87 @@
     m_pNode = NULL; 
     
     if (!isFault && AXIS_FAIL == m_nStatus)  
+    {
+    	logExitWithPointer(NULL)
+
         return NULL;  
+    }
         
     // Call the Axis-generated routine that will deserialize complex object,
     // including any attributes.
     
-    TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, 0);
+    logDebugArg1("Calling object create function %p", pCreFunct)
+    
     void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (0);
-    TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
     
+    logDebugArg2("Returned from object create function %p, returned object %p", pCreFunct, pObject)
+
     if (pObject && pDZFunct)
     {
         try 
         {        
-            TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
+            logDebugArg1("Calling object deserializer function %p", pDZFunct)
+            
             m_nStatus =    ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
-            TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+            
+            logDebugArg2("Returned from object deserializer function %p, status=%d", pDZFunct, m_nStatus)
+
         
             if (AXIS_SUCCESS == m_nStatus)
                 skipNode();
             else
             {
-                TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, 0);
+                logDebugArg2("Calling object delete function %p for object %p", pDelFunct, pObject)
+                
                 ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, 0);
-                TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+                
+                logDebugArg1("Returned from object delete function %p", pDelFunct)
             
                 pObject = NULL;
             }
         }
         catch ( ... )
         {
-            TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, 0);
+            logDebugArg2("Calling object delete function %p for object %p", pDelFunct, pObject)
+            
             ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, 0);
-            TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+            
+            logDebugArg1("Returned from object delete function %p", pDelFunct)
+
+            logRethrowException()
 
             throw;
         }
     }
 
+	logExitWithPointer(pObject)
+
     return pObject;
 }
 
 void * SoapDeSerializer::
 getAttribute(const AxisChar* pName, const AxisChar * pNamespace, IAnySimpleType * pSimpleType)
 {
+	logEntryEngine("SoapDeSerializer::getAttribute")
+
+    void *returnValue = NULL;
+	
     if (m_pCurrNode)
+    {
         for (int i=0; m_pCurrNode->m_pchAttributes[i]; i += 3)
+        {
             if (0 == strcmp(m_pCurrNode->m_pchAttributes[i], pName))
             {
                 pSimpleType->deserialize(m_pCurrNode->m_pchAttributes[i+2]);
-                return pSimpleType->getValue();
+                returnValue = pSimpleType->getValue();
+                break;
             }
+        }
+    }
     
-    return NULL;
+	logExitWithPointer(returnValue)
+
+    return returnValue;
 }
 
 xsd__int *SoapDeSerializer::
@@ -1209,6 +1387,8 @@
 bool SoapDeSerializer::
 isNilValue()
 {
+	logEntryEngine("SoapDeSerializer::isNilValue")
+
     bool isNillResult = false;    
 
     // Go through the attributes looking for nil.  We consider
@@ -1226,12 +1406,16 @@
         }
     }
 
+    logExitWithBoolean(isNillResult)
+    
     return isNillResult;
 }
 
 void SoapDeSerializer::
 processFaultDetail(IAnySimpleType * pSimpleType, const AxisChar* elementValue)
 {
+	logEntryEngine("SoapDeSerializer::processFaultDetail")
+
     bool isWhiteSpace = true;
     
     int len = elementValue ? strlen(elementValue) : 0;
@@ -1261,6 +1445,9 @@
         if (nextName[0] != 0x00)
         {
             m_pNode = NULL; // node consumed
+            
+            logExit()
+            
             return;
         }
     }
@@ -1269,6 +1456,8 @@
     pSimpleType->deserialize(workingString);
     skipNode();        
     
+    logExit()
+    
     return;
 }
 
@@ -1276,12 +1465,22 @@
 getElement (const AxisChar * pName, const AxisChar * pNamespace,
             IAnySimpleType * pSimpleType,
             bool isArrayElement)
-{   
+{  
+	logEntryEngine("SoapDeSerializer::getElement")
+
     if (AXIS_SUCCESS != m_nStatus)
+    {
+    	logExit()
+    	
         return;
+    }
         
     if (AXIS_FAIL == getNextNode(RPC_ENCODED != m_nStyle))
+    {
+    	logExit()
+    	
         return;
+    }
 
     bool    bNillFound = false;
     if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
@@ -1296,14 +1495,26 @@
             m_nStatus = AXIS_FAIL;
     }
     else if (0 != strcmp (pName, m_pNode->m_pchNameOrValue))
-       return;
+    {
+    	logExit()
+    	
+    	return;
+    }
     
     if (AXIS_FAIL == m_nStatus)
+    {
+    	logExit()
+    	
         return;
+    }
     
     // get next element, character mode 
     if (AXIS_FAIL == getNextNode(false, true))
-       return;
+    {
+    	logExit()
+    	
+    	return;
+    }
       
     if (CHARACTER_ELEMENT == m_pNode->m_type)
     {
@@ -1326,6 +1537,8 @@
         m_pNode = NULL;
     }
 
+    logExit()
+    
     return;
 }
 
@@ -1749,30 +1962,32 @@
 {
     foundType = false;
     
+	XSDTYPE type = XSD_UNKNOWN;
+	
     /* first check whether this is a start element node */
-    if (START_ELEMENT != pElement->m_type)
-        return XSD_UNKNOWN;
-
-    for (int i = 0; pElement->m_pchAttributes[i]; i += 3)
+    if (START_ELEMENT == pElement->m_type)
     {
-        if (URI_XSI == URIMapping::getURI (pElement->m_pchAttributes[i + 1]))
-        {
-            ::QName qn;
-            XSDTYPE type = XSD_UNKNOWN;
-            qn.splitQNameString (pElement->m_pchAttributes[i + 2], ':');
-            const char * pNS = m_pParser->getNS4Prefix (qn.uri);
-            if (pNS)
-            {
-                if (URI_XSD == URIMapping::getURI (pNS) || URI_ENC == URIMapping::getURI (pNS))
-                    type = TypeMapping::map (qn.localname);
-            }
-            qn.mergeQNameString (':');
-            foundType = true;
-            return type;
-        }
+	    for (int i = 0; pElement->m_pchAttributes[i]; i += 3)
+	    {
+	        if (URI_XSI == URIMapping::getURI (pElement->m_pchAttributes[i + 1]))
+	        {
+	            ::QName qn;
+	            
+	            qn.splitQNameString (pElement->m_pchAttributes[i + 2], ':');
+	            const char * pNS = m_pParser->getNS4Prefix (qn.uri);
+	            if (pNS)
+	            {
+	                if (URI_XSD == URIMapping::getURI (pNS) || URI_ENC == URIMapping::getURI (pNS))
+	                    type = TypeMapping::map (qn.localname);
+	            }
+	            qn.mergeQNameString (':');
+	            foundType = true;
+	            break;
+	        }
+	    }
     }
 
-    return XSD_UNKNOWN;
+    return type;
 }
 
 /*
@@ -1784,10 +1999,16 @@
 HeaderBlock * SoapDeSerializer::
 getHeaderBlock ()
 {
-    if (!m_pHeader)
-        return NULL;
+	logEntryEngine("SoapDeSerializer::getHeaderBlock")
 
-    return (HeaderBlock *) m_pHeader->getHeaderBlock (true);
+    HeaderBlock *returnValue = NULL;
+	
+    if (m_pHeader)
+    	returnValue = (HeaderBlock *) m_pHeader->getHeaderBlock (true);
+    
+    logExitWithPointer(returnValue)
+    
+    return returnValue;
 }
 
 /*
@@ -1797,9 +2018,14 @@
 int AXISCALL SoapDeSerializer::
 addHeaderBlock (IHeaderBlock * pBlk)
 {
+	logEntryEngine("SoapDeSerializer::addHeaderBlock")
+
     if (!m_pHeader)
         m_pHeader = new SoapHeader ();
     m_pHeader->addHeaderBlock ((HeaderBlock *) pBlk);
+    
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
@@ -1911,128 +2137,142 @@
 int SoapDeSerializer::
 flushInputStream ()
 {
-    int nChars = 100;
-    char pBuffer[100];
-    
-    if (!m_pInputStream)
-        return AXIS_FAIL;
+	logEntryEngine("SoapDeSerializer::flushInputStream")
+
+    int iStatus = AXIS_FAIL;
     
-    while (TRANSPORT_IN_PROGRESS == m_pInputStream->getBytes (pBuffer, &nChars));
+    if (m_pInputStream)
+    {
+        int nChars = 100;
+        char pBuffer[100];
+        
+    	while (TRANSPORT_IN_PROGRESS == m_pInputStream->getBytes (pBuffer, &nChars));
+    	iStatus = AXIS_SUCCESS;
+    }
     
-    return AXIS_SUCCESS;
+    logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 
 AnyType * SoapDeSerializer::
 getAnyObject ()
 {
+	logEntryEngine("SoapDeSerializer::getAnyObject")
+
     // Parser will throw an exception on a parser exception, that is ok...
     if (!m_pNode)
         m_pNode = m_pParser->anyNext();
-    if (!m_pNode)
-        return NULL;
-    
-    int tagCount = 0;
-    int lstSize = 0;
-    bool bContinue = false;
-
-    AxisString xmlStr = "";
-    AxisString nsDecls = "";
-
-    list < AxisString > lstXML;
-
-	AxisString inValue = "";
-	AxisString outValue = "";
-
-    while ((END_ELEMENT != m_pNode->m_type) || (tagCount >= 0) || bContinue)
-    {
-        // Continue if processing start prefix,
-        // as we haven't yet found the true start of the tag
-        if (START_PREFIX == m_pNode->m_type)
-            bContinue = true;
-        else
-            bContinue = false;
-        
-        // Increment counter if entering new tag, Decrement counter if exiting tag
-        if (START_ELEMENT == m_pNode->m_type && START_END_ELEMENT != m_pNode->m_type2)
-            tagCount++;
-        else if (END_ELEMENT == m_pNode->m_type)
-            tagCount--;
-
-        if (START_PREFIX == m_pNode->m_type)
-        {
-            nsDecls += " xmlns";
-            if (m_pNode->m_pchNameOrValue && (*(m_pNode->m_pchNameOrValue) != 0x00))
-            {
-                nsDecls += ":";
-                nsDecls += m_pNode->m_pchNameOrValue;
-            }
-            nsDecls += "=\"";
-            nsDecls += m_pNode->m_pchNamespace;
-            nsDecls += "\"";
-        }
-        else if (CHARACTER_ELEMENT != m_pNode->m_type)
-        {
-            serializeTag (xmlStr, m_pNode, nsDecls);
-            nsDecls = "";
-        }
-        else
-        {
-        	inValue = m_pNode->m_pchNameOrValue;
-        	IAnySimpleType::replaceReservedCharacters(inValue, outValue);
-            xmlStr += outValue;
-        }
-    
-        if ( !bContinue && tagCount == 0 && (!xmlStr.empty ()))    /* copying the First level element into the list */
-        {
-            lstXML.push_back (xmlStr);
-            xmlStr = "";
-            m_pNode = NULL;
-            break;
-        }
-    
-        m_pNode = m_pParser->anyNext ();
-    
-        if (!m_pNode) // there is something wrong in the XSD Any XML stream
-        {          
-            // Store whatever we have by now and break
-            if (!xmlStr.empty ())
-            {
-                lstXML.push_back (xmlStr);
-                xmlStr = "";
-            }
-            break;
-        }
+	
+	AnyType *pAny = NULL;
+	
+    if (m_pNode)
+	{    
+	    int tagCount = 0;
+	    int lstSize = 0;
+	    bool bContinue = false;
+	
+	    AxisString xmlStr = "";
+	    AxisString nsDecls = "";
+	
+	    list < AxisString > lstXML;
+	
+		AxisString inValue = "";
+		AxisString outValue = "";
+	
+	    while ((END_ELEMENT != m_pNode->m_type) || (tagCount >= 0) || bContinue)
+	    {
+	        // Continue if processing start prefix,
+	        // as we haven't yet found the true start of the tag
+	        if (START_PREFIX == m_pNode->m_type)
+	            bContinue = true;
+	        else
+	            bContinue = false;
+	        
+	        // Increment counter if entering new tag, Decrement counter if exiting tag
+	        if (START_ELEMENT == m_pNode->m_type && START_END_ELEMENT != m_pNode->m_type2)
+	            tagCount++;
+	        else if (END_ELEMENT == m_pNode->m_type)
+	            tagCount--;
+	
+	        if (START_PREFIX == m_pNode->m_type)
+	        {
+	            nsDecls += " xmlns";
+	            if (m_pNode->m_pchNameOrValue && (*(m_pNode->m_pchNameOrValue) != 0x00))
+	            {
+	                nsDecls += ":";
+	                nsDecls += m_pNode->m_pchNameOrValue;
+	            }
+	            nsDecls += "=\"";
+	            nsDecls += m_pNode->m_pchNamespace;
+	            nsDecls += "\"";
+	        }
+	        else if (CHARACTER_ELEMENT != m_pNode->m_type)
+	        {
+	            serializeTag (xmlStr, m_pNode, nsDecls);
+	            nsDecls = "";
+	        }
+	        else
+	        {
+	        	inValue = m_pNode->m_pchNameOrValue;
+	        	IAnySimpleType::replaceReservedCharacters(inValue, outValue);
+	            xmlStr += outValue;
+	        }
+	    
+	        if ( !bContinue && tagCount == 0 && (!xmlStr.empty ()))    /* copying the First level element into the list */
+	        {
+	            lstXML.push_back (xmlStr);
+	            xmlStr = "";
+	            m_pNode = NULL;
+	            break;
+	        }
+	    
+	        m_pNode = m_pParser->anyNext ();
+	    
+	        if (!m_pNode) // there is something wrong in the XSD Any XML stream
+	        {          
+	            // Store whatever we have by now and break
+	            if (!xmlStr.empty ())
+	            {
+	                lstXML.push_back (xmlStr);
+	                xmlStr = "";
+	            }
+	            break;
+	        }
+	    }
+	
+	    pAny = new AnyType ();
+	    pAny->_array = 0;
+	    pAny->_size = 0;
+	    
+	    lstSize = lstXML.size ();
+	    
+	    if (lstSize > 0)
+	    {
+	        pAny->_array = new char *[lstSize];
+	
+	        list < AxisString >::iterator i;    /* Iterator for traversing the list */
+	    
+	        for (i = lstXML.begin (); i != lstXML.end (); i++)
+	        {
+	            const char *s = (*i).c_str ();
+	            pAny->_array[pAny->_size] = new char[strlen (s) + 1];
+	            strcpy (pAny->_array[pAny->_size], s);
+	            pAny->_size++;
+	        }
+	    }
     }
 
-    AnyType *pAny = new AnyType ();
-    pAny->_array = 0;
-    pAny->_size = 0;
-    
-    lstSize = lstXML.size ();
-    
-    if (lstSize > 0)
-    {
-        pAny->_array = new char *[lstSize];
-
-        list < AxisString >::iterator i;    /* Iterator for traversing the list */
-    
-        for (i = lstXML.begin (); i != lstXML.end (); i++)
-        {
-            const char *s = (*i).c_str ();
-            pAny->_array[pAny->_size] = new char[strlen (s) + 1];
-            strcpy (pAny->_array[pAny->_size], s);
-            pAny->_size++;
-        }
-    }
+    logExitWithPointer(pAny)
 
     return pAny;
 }
 
 
-void
-SoapDeSerializer::serializeTag (AxisString & xmlStr, 
-                                const AnyElement * node,
-                                AxisString & nsDecls)
+void SoapDeSerializer::
+serializeTag (AxisString & xmlStr, 
+              const AnyElement * node,
+              AxisString & nsDecls)
 {
     /*
        Note that if this is an end tag and since m_pchNameOrValue doesn't give
@@ -2178,17 +2418,21 @@
 void SoapDeSerializer::
 getChardataAs (void **pValue, XSDTYPE type)
 {  
-    if (!pValue || AXIS_FAIL == getNextNode(true, true))
-        return;
-    
-    *pValue = NULL;
-    if (CHARACTER_ELEMENT == m_pNode->m_type)
+	logEntryEngine("SoapDeSerializer::getChardataAs")
+
+    if (pValue && AXIS_FAIL != getNextNode(true, true))
     {
-        IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(type);
-        pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
-        *pValue = pSimpleType->getValue();
-        delete pSimpleType;
+	    *pValue = NULL;
+	    if (CHARACTER_ELEMENT == m_pNode->m_type)
+	    {
+	        IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(type);
+	        pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
+	        *pValue = pSimpleType->getValue();
+	        delete pSimpleType;
+	    }
     }
+    
+    logExit()
 }
 
 /* This function is never called. */
@@ -2203,17 +2447,30 @@
 DeSerializerMemBufInputStream::
 getBytes (char *pcBuffer, int *piRetSize)
 {
+	logEntryEngine("SoapDeSerializer::DeSerializerMemBufInputStream::getBytes")
+
     if (!m_pcDeSeriaMemBuffer)
+    {
+    	logExitWithMessage("Returned return code of TRANSPORT_FAILED")
+    	
         return TRANSPORT_FAILED;
+    }
         
     int nBufLen = strlen (m_pcDeSeriaMemBuffer);
     if (0 == nBufLen)
+    {
+    	logExitWithMessage("Returned return code of TRANSPORT_FINISHED")
+
         return TRANSPORT_FINISHED;
+    }
         
     nBufLen = ((*piRetSize - 1) < nBufLen) ? (*piRetSize - 1) : nBufLen;
     strncpy (pcBuffer, m_pcDeSeriaMemBuffer, nBufLen);
     pcBuffer[nBufLen] = 0;
     m_pcDeSeriaMemBuffer += nBufLen;
+    
+	logExitWithMessage("Returned return code of TRANSPORT_IN_PROGRESS")
+
     return TRANSPORT_IN_PROGRESS;
 }
 
@@ -2238,7 +2495,11 @@
 void SoapDeSerializer::
 setMethodNameToInvoke(const char* methodName)
 {
+	logEntryEngine("SoapDeSerializer::setMethodNameToInvoke")
+
     m_strMethodNameToInvoke = methodName;
+	
+    logExit()
 }
 
 AXIS_CPP_NAMESPACE_END

Modified: webservices/axis/trunk/c/src/soap/SoapEnvelope.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapEnvelope.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapEnvelope.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapEnvelope.cpp Thu Nov 13 14:13:23 2008
@@ -37,14 +37,22 @@
 
 extern SoapEnvVersionsStruct gs_SoapEnvVersionsStruct[VERSION_LAST];
 
-SoapEnvelope::SoapEnvelope()
+SoapEnvelope::
+SoapEnvelope()
 {
+	logEntryEngine("SoapEnvelope::SoapEnvelope")
+
     m_pSoapHeader= NULL;
     m_pSoapBody= NULL;
+    
+	logExit()
 }
 
-SoapEnvelope::~SoapEnvelope()
+SoapEnvelope::
+~SoapEnvelope()
 {
+	logEntryEngine("SoapEnvelope::~SoapEnvelope")
+
     // deletion of attributes 
     list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
 
@@ -68,30 +76,39 @@
     m_namespaceDecls.clear();
 
     // deletion of soap header 
-    if (m_pSoapHeader)
-    {
-        delete m_pSoapHeader;
-    }
+    delete m_pSoapHeader;
 
     // deletion of soap body 
-    if (m_pSoapBody)
-    {
-        delete m_pSoapBody;
-    }
+    delete m_pSoapBody;
+    
+	logExit()
 }
 
-void SoapEnvelope::setSoapHeader(SoapHeader* soapHeader)
+void SoapEnvelope::
+setSoapHeader(SoapHeader* soapHeader)
 {
+	logEntryEngine("SoapEnvelope::setSoapHeader")
+
     m_pSoapHeader= soapHeader;
+	
+	logExit()
 }
 
-void SoapEnvelope::setSoapBody(SoapBody* soapBody)
+void SoapEnvelope::
+setSoapBody(SoapBody* soapBody)
 {
+	logEntryEngine("SoapEnvelope::setSoapBody")
+
     m_pSoapBody= soapBody;
+	
+	logExit()
 }
 
-int SoapEnvelope::serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
+int SoapEnvelope::
+serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
 {    
+	logEntryEngine("SoapEnvelope::serialize")
+
     int iStatus= AXIS_SUCCESS;
     do
     {            
@@ -106,47 +123,57 @@
         {
             iStatus= m_pSoapHeader->serialize(pSZ, eSoapVersion);
             if (iStatus == AXIS_FAIL)
-            {
                 break;
-            }
         }
         if (m_pSoapBody!=NULL)
         {
             iStatus= m_pSoapBody->serialize(pSZ, eSoapVersion);
             if (iStatus == AXIS_FAIL)
-            {
                 break;
-            }
         }
         else
-        {
              iStatus = AXIS_FAIL;
-        }
                 
         pSZ.serialize("</", gs_SoapEnvVersionsStruct[eSoapVersion].pchPrefix,
             ":", gs_SoapEnvVersionsStruct[eSoapVersion].pchWords[SKW_ENVELOPE],
             ">\n\n", NULL);
-    } while (0);
+    } 
+    while (0);
 
+	logExitWithReturnCode(iStatus)
+	
     return iStatus;
 }
 
-int SoapEnvelope::addAttribute(Attribute *pAttribute)
+int SoapEnvelope::
+addAttribute(Attribute *pAttribute)
 {
+	logEntryEngine("SoapEnvelope::addAttribute")
+
     m_attributes.push_back(pAttribute);
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+	
     return AXIS_SUCCESS;
 }
 
-int SoapEnvelope::addNamespaceDecl(Attribute *pAttribute)
+int SoapEnvelope::
+addNamespaceDecl(Attribute *pAttribute)
 {
+	logEntryEngine("SoapEnvelope::addNamespaceDecl")
+
     m_namespaceDecls.push_back(pAttribute);
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+	
     return AXIS_SUCCESS;
 }
 
-int SoapEnvelope::serializeAttributes(SoapSerializer& pSZ)
+int SoapEnvelope::
+serializeAttributes(SoapSerializer& pSZ)
 {    
+	logEntryEngine("SoapEnvelope::serializeAttributes")
+
     list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
 
     while (itCurrAttribute != m_attributes.end())
@@ -155,11 +182,15 @@
         itCurrAttribute++;        
     }    
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+	
     return AXIS_SUCCESS;    
 }
 
-int SoapEnvelope::serializeNamespaceDecl(SoapSerializer& pSZ)
+int SoapEnvelope::
+serializeNamespaceDecl(SoapSerializer& pSZ)
 {    
+	logEntryEngine("SoapEnvelope::serializeNamespaceDecl")
 
     list<Attribute*>::iterator itCurrNamespaceDecl= m_namespaceDecls.begin();
 
@@ -169,37 +200,60 @@
         (*itCurrNamespaceDecl)->serialize(pSZ);
         itCurrNamespaceDecl++;        
     }    
+    
+	logExitWithReturnCode(AXIS_SUCCESS)
 
     return AXIS_SUCCESS;
 }
 
-int SoapEnvelope::setPrefix(const AxisChar* prefix)
+int SoapEnvelope::
+setPrefix(const AxisChar* prefix)
 {
+	logEntryEngine("SoapEnvelope::setPrefix")
+
     m_sPrefix= prefix;
+	
+	logExitWithReturnCode(AXIS_SUCCESS)
 
     return AXIS_SUCCESS;
 }
 
-int SoapEnvelope::addStandardNamespaceDecl(const Attribute *pAttribute)
+int SoapEnvelope::
+addStandardNamespaceDecl(const Attribute *pAttribute)
 {
+	logEntryEngine("SoapEnvelope::addStandardNamespaceDecl")
+
     m_StandardNamespaceDecls.push_back(pAttribute);
+	
+	logExitWithReturnCode(AXIS_SUCCESS)
+	
     return AXIS_SUCCESS;
 }
 
-void SoapEnvelope::clearStandardNamespaceDecl()
+void SoapEnvelope::
+clearStandardNamespaceDecl()
 {
+	logEntryEngine("SoapEnvelope::clearStandardNamespaceDecl")
+
     m_StandardNamespaceDecls.clear();
+	
+	logExit()
 }
 
-int SoapEnvelope::serializeStandardNamespaceDecl(SoapSerializer &pSZ)
+int SoapEnvelope::
+serializeStandardNamespaceDecl(SoapSerializer &pSZ)
 {
-    list<const Attribute*>::iterator itCurrNamespaceDecl= 
-        m_StandardNamespaceDecls.begin();
+	logEntryEngine("SoapEnvelope::serializeStandardNamespaceDecl")
+
+    list<const Attribute*>::iterator itCurrNamespaceDecl= m_StandardNamespaceDecls.begin();
     while (itCurrNamespaceDecl != m_StandardNamespaceDecls.end()) 
     {            
         (*itCurrNamespaceDecl)->serialize(pSZ);
         itCurrNamespaceDecl++;        
     }    
+    
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 

Modified: webservices/axis/trunk/c/src/soap/SoapFault.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapFault.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapFault.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapFault.cpp Thu Nov 13 14:13:23 2008
@@ -67,6 +67,8 @@
 int SoapFault::
 serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
 {
+	logEntryEngine("SoapFault::serialize")
+
     // written according to SOAP Version 1.1
     int iStatus= AXIS_SUCCESS;
     pSZ.setStyle(DOC_LITERAL);
@@ -89,6 +91,8 @@
     pSZ.serialize("</", gs_SoapEnvVersionsStruct[eSoapVersion].pchPrefix, ":",
         gs_SoapEnvVersionsStruct[eSoapVersion].pchWords[SKW_FAULT], ">\n", NULL);
 
+    logExitWithReturnCode(iStatus)
+
     return iStatus;
 }
 
@@ -193,6 +197,8 @@
 SoapFault* SoapFault::
 getSoapFault(int iFaultCode)
 {   
+	logEntryEngine("SoapFault::getSoapFault")
+
     SoapFault* pSoapFault= NULL;
 
     // fill the soap fault object 
@@ -218,90 +224,132 @@
     pSoapFault->setFaultactor(strUrl.c_str());             
     pSoapFault->setFaultDetail(s_parrSoapFaultStruct[iFaultCode].pcFaultDetail);
     
+    logExitWithPointer(pSoapFault)
+    
     return pSoapFault;
 }
 
 SoapFault::
 SoapFault(string sFaultcode, string sFaultstring, string sFaultactor, string sDetail) 
 {
+	logEntryEngine("SoapFault::SoapFault")
+
     m_sFaultcode= sFaultcode;
     m_sFaultstring= sFaultstring;
     m_sFaultactor= sFaultactor;
     m_sFaultDetail= sDetail;    
+    
+    logExit()
 }
 
 int SoapFault::
 setParam(Param* pParam, const AxisChar* pchName, const void* pValue, XSDTYPE type)
 {
-    if (!pParam) 
-        return AXIS_FAIL;
-        
-    pParam->m_sName = pchName;
-    pParam->setValue( type , (IAnySimpleType*) pValue);
+	logEntryEngine("SoapFault::setParam")
+
+	int Status = AXIS_FAIL;
+	
+    if (pParam) 
+    {        
+    	pParam->m_sName = pchName;
+    	pParam->setValue( type , (IAnySimpleType*) pValue);
+    	Status = AXIS_SUCCESS;
+    }
     
-    return AXIS_SUCCESS;
+    logExitWithReturnCode(Status)
+    
+    return Status;
 }
 
 int SoapFault::
 setFaultcode(const AxisChar* sFaultcode)
 {
+	logEntryEngine("SoapFault::setFaultcode")
+
     m_pFaultcodeParam = new Param();
     setParam(m_pFaultcodeParam, "faultcode", new String((xsd__string)sFaultcode), XSD_STRING); 
     m_sFaultcode= sFaultcode;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapFault::
 setFaultstring(const AxisChar* sFaultstring)
 {
+	logEntryEngine("SoapFault::setFaultstring")
+
     m_pFaultstringParam = new Param();
     setParam(m_pFaultstringParam, "faultstring", new String((xsd__string)sFaultstring), XSD_STRING); 
     m_sFaultstring= sFaultstring;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 int SoapFault::
 setFaultactor(const AxisChar* sFaultactor)
 {
+	logEntryEngine("SoapFault::setFaultactor")
+
     m_pFaultactorParam = new Param();
     setParam(m_pFaultactorParam, "faultactor", new String((xsd__string)sFaultactor), XSD_STRING); 
     m_sFaultactor = sFaultactor;
     
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapFault::
 setFaultDetail(const AxisChar* sFaultDetail)
 {
+	logEntryEngine("SoapFault::setFaultDetail")
+
     m_pFaultDetail = new Param();
     setParam(m_pFaultDetail, "appSpecific", new String((xsd__string)sFaultDetail), XSD_STRING);
     m_sFaultDetail = sFaultDetail;
     m_bIsSimpleDetail = true;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapFault::
 setFaultDetail(const Param* pFaultDetail)
 {
+	logEntryEngine("SoapFault::setFaultDetail")
+
     m_pFaultDetail = (Param*) pFaultDetail;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapFault::
 setCmplxFaultObjectName(const string& sCmplxFaultObjectName)
 {
+	logEntryEngine("SoapFault::setCmplxFaultObjectName")
+
     m_sCmplxFaultObjectName = sCmplxFaultObjectName;
+	
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapFault::
 setCmplxFaultObject(const void* pCmplxFaultObject)
 {
+	logEntryEngine("SoapFault::setCmplxFaultObject")
+
     m_pCmplxFaultObject = pCmplxFaultObject;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 

Modified: webservices/axis/trunk/c/src/soap/SoapHeader.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapHeader.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapHeader.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapHeader.cpp Thu Nov 13 14:13:23 2008
@@ -35,12 +35,19 @@
 
 extern SoapEnvVersionsStruct gs_SoapEnvVersionsStruct[VERSION_LAST];
 
-SoapHeader::SoapHeader()
+SoapHeader::
+SoapHeader()
 {	
+	logEntryEngine("SoapHeader::SoapHeader")
+	
+    logExit()
 }
 
-SoapHeader::~SoapHeader()
+SoapHeader::
+~SoapHeader()
 {
+	logEntryEngine("SoapHeader::~SoapHeader")
+
     // Header blocks are not deleted here any more. Its the responsibility of
     // either a handler or stub etc to delete any header block created by them
     // Here we will just clear the list of header block pointers
@@ -56,23 +63,34 @@
     }
 
     m_attributes.clear();
+    
+    logExit()
 }
 
-void SoapHeader::addHeaderBlock(IHeaderBlock* pHeaderBlock)
+void SoapHeader::
+addHeaderBlock(IHeaderBlock* pHeaderBlock)
 {
+	logEntryEngine("SoapHeader::addHeaderBlock")
+
     if (pHeaderBlock)
     {
         m_headerBlocks.push_back(pHeaderBlock);
     }
+	
+	logExit()
 }
 
-int SoapHeader::serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
+int SoapHeader::
+serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
 {    
+	logEntryEngine("SoapHeader::serialize")
+
     int iStatus= AXIS_SUCCESS;
 
     do
     {
-		if (0 == m_headerBlocks.size()) break;
+		if (0 == m_headerBlocks.size()) 
+			break;
         
         pSZ.serialize("<", gs_SoapEnvVersionsStruct[eSoapVersion].pchPrefix,
             ":", gs_SoapEnvVersionsStruct[eSoapVersion].pchWords[SKW_HEADER],
@@ -82,9 +100,7 @@
         iStatus= serializeAttributes(pSZ);
 
         if(iStatus==AXIS_FAIL)
-        {
             break;
-        }
         
         pSZ.serialize(">", NULL);
 
@@ -94,44 +110,49 @@
         {
             iStatus= ((HeaderBlock*)(*itCurrHeaderBlock))->serialize(pSZ);
             if(iStatus==AXIS_FAIL)
-            {
                 break;
-            }
             itCurrHeaderBlock++;            
         }
 
         if(iStatus==AXIS_FAIL)
-        {
             break;
-        }
         
         pSZ.serialize("</", gs_SoapEnvVersionsStruct[eSoapVersion].pchPrefix,
             ":", gs_SoapEnvVersionsStruct[eSoapVersion].pchWords[SKW_HEADER],
             ">\n", NULL);
         
-    } while(0);
+    } 
+    while(0);
 
-    return iStatus;
+	logExitWithReturnCode(iStatus)
 
+    return iStatus;
 }
 
-int SoapHeader::addAttribute(Attribute *pAttribute)
+int SoapHeader::
+addAttribute(Attribute *pAttribute)
 {
+	logEntryEngine("SoapHeader::addAttribute")
+	
+	int iStatus = AXIS_FAIL;
+
     if (pAttribute)
     {
         m_attributes.push_back(pAttribute);
-
-        return AXIS_SUCCESS;
-    }
-    else
-    {
-        return AXIS_FAIL;
+        iStatus = AXIS_SUCCESS;
     }
+
+	logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 
 
-int SoapHeader::serializeAttributes(SoapSerializer& pSZ)
+int SoapHeader::
+serializeAttributes(SoapSerializer& pSZ)
 {
+	logEntryEngine("SoapHeader::serializeAttributes")
+
     list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
 
     while(itCurrAttribute != m_attributes.end())
@@ -140,39 +161,52 @@
         itCurrAttribute++;        
     }    
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;    
 }
 
-int SoapHeader::addNamespaceDecl(Attribute *pAttribute)
+int SoapHeader::
+addNamespaceDecl(Attribute *pAttribute)
 {
+	logEntryEngine("SoapHeader::addNamespaceDecl")
+
+	int iStatus = AXIS_FAIL;
+	
     if (pAttribute)
     {
         m_namespaceDecls.push_back(pAttribute);
-
-        return AXIS_SUCCESS;
-    }
-    else
-    {
-        return AXIS_FAIL;
+        iStatus = AXIS_SUCCESS;
     }
+	
+	logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 
-int SoapHeader::serializeNamespaceDecl(SoapSerializer& pSZ)
+int SoapHeader::
+serializeNamespaceDecl(SoapSerializer& pSZ)
 {
+	logEntryEngine("SoapHeader::serializeNamespaceDecl")
+
     list<Attribute*>::iterator itCurrNamespaceDecl= m_namespaceDecls.begin();
 
     while(itCurrNamespaceDecl != m_namespaceDecls.end())
     {
-
         (*itCurrNamespaceDecl)->serialize(pSZ);
         itCurrNamespaceDecl++;        
     }    
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
-IHeaderBlock* SoapHeader::getHeaderBlock(bool bRemoveOrNot)
+IHeaderBlock* SoapHeader::
+getHeaderBlock(bool bRemoveOrNot)
 {
+	logEntryEngine("SoapHeader::getHeaderBlock")
+
     IHeaderBlock* tmpHeaderBlock = NULL;
 
     list<IHeaderBlock*>::iterator itCurrHeaderBlock= m_headerBlocks.begin();
@@ -180,30 +214,32 @@
     if(itCurrHeaderBlock != m_headerBlocks.end())
     {
         tmpHeaderBlock = (*itCurrHeaderBlock);
-		if (bRemoveOrNot == true) {
+		if (bRemoveOrNot == true)
 			m_headerBlocks.pop_front();
-		}
     }
 
+    logExitWithPointer(tmpHeaderBlock)
+
     return tmpHeaderBlock;
 
 }
 
-int SoapHeader::setPrefix(const char* pcPrefix)
+int SoapHeader::
+setPrefix(const char* pcPrefix)
 {
     m_pcPrefix = pcPrefix;
 
     return AXIS_SUCCESS;
 }
 
-IHeaderBlock* SoapHeader::getHeaderBlock(const AxisChar *pName,
-                                         const AxisChar *pNamespace, 
-										 bool bRemoveOrNot)
+IHeaderBlock* SoapHeader::
+getHeaderBlock(const AxisChar *pName, const AxisChar *pNamespace, bool bRemoveOrNot)
 {
+	logEntryEngine("SoapHeader::getHeaderBlock")
+
     HeaderBlock* tmpHeaderBlock = NULL;
 
     list<IHeaderBlock*>::iterator itCurrHeaderBlock= m_headerBlocks.begin();
-    bool blnFoundStatus = false;
 
     while (itCurrHeaderBlock != m_headerBlocks.end())
     {
@@ -212,60 +248,73 @@
         if ((strcmp(((tmpHeaderBlock)->m_localname).c_str(), pName) == 0) && 
                 (strcmp(((tmpHeaderBlock)->m_uri).c_str(), pNamespace) == 0))
         {
-            blnFoundStatus = true;
-			if (bRemoveOrNot == true) {
+			if (bRemoveOrNot == true)
 				m_headerBlocks.remove(tmpHeaderBlock);
-			}
             break;
         }
         else
         {
+        	tmpHeaderBlock = NULL;
             itCurrHeaderBlock++;
         }
     }
 
-    if (blnFoundStatus == true)
-    {
-        return tmpHeaderBlock;
-    }
-    else
-    {
-        return NULL;
-    }
+    logExitWithPointer(tmpHeaderBlock)
+
+    return tmpHeaderBlock;
 }
 
  
-IHeaderBlock* SoapHeader::getFirstHeaderBlock() 
+IHeaderBlock* SoapHeader::
+getFirstHeaderBlock() 
 {
+	logEntryEngine("SoapHeader::getFirstHeaderBlock")
+
 	m_itHeaderBlocks = m_headerBlocks.begin();
 	IHeaderBlock* tmpIHeaderBlock=NULL;
 	if (m_itHeaderBlocks != m_headerBlocks.end())
 		tmpIHeaderBlock = *m_itHeaderBlocks;
+	
+    logExitWithPointer(tmpIHeaderBlock)
+
 	return tmpIHeaderBlock;
 }
 
-IHeaderBlock* SoapHeader::getNextHeaderBlock() 
+IHeaderBlock* SoapHeader::
+getNextHeaderBlock() 
 {
+	logEntryEngine("SoapHeader::getNextHeaderBlock")
+
 	m_itHeaderBlocks++;
 	IHeaderBlock* tmpIHeaderBlock=NULL;
 	if (m_itHeaderBlocks != m_headerBlocks.end())
 		tmpIHeaderBlock = *m_itHeaderBlocks;
+	
+    logExitWithPointer(tmpIHeaderBlock)
+
 	return tmpIHeaderBlock;
 }
 
-IHeaderBlock* SoapHeader::getCurrentHeaderBlock()
+IHeaderBlock* SoapHeader::
+getCurrentHeaderBlock()
 {
+	logEntryEngine("SoapHeader::getCurrentHeaderBlock")
+
 	IHeaderBlock* tmpIHeaderBlock=NULL;
 	if (m_itHeaderBlocks != m_headerBlocks.end())
 		tmpIHeaderBlock = *m_itHeaderBlocks;
 
+    logExitWithPointer(tmpIHeaderBlock)
+
 	return tmpIHeaderBlock;
 }
 
 
-int SoapHeader::deleteHeaderBlock(const AxisChar *pName,
-                                         const AxisChar *pNamespace)
+int SoapHeader::
+deleteHeaderBlock(const AxisChar *pName, const AxisChar *pNamespace)
 {
+	logEntryEngine("SoapHeader::deleteHeaderBlock")
+
     int iStatus = AXIS_SUCCESS;
     HeaderBlock* tmpHeaderBlock = NULL;
 
@@ -282,21 +331,22 @@
             break; 
         }
         else
-        {
             itCurrHeaderBlock++;
-        }
-    
     }
 
     if (m_headerBlocks.empty())
-    {
-        iStatus = AXIS_NO_REMAINING_SOAP_HEADERS;                     
-    }
+        iStatus = AXIS_NO_REMAINING_SOAP_HEADERS;
     
+	logExitWithReturnCode(iStatus)
+
     return iStatus;
 }
-void SoapHeader::clear()
+
+void SoapHeader::
+clear()
 {
+	logEntryEngine("SoapHeader::clear")
+
     // Header blocks are not deleted here. Its the responsibility of
     // either a handler or stub etc to delete any header block created by them
     // Here we will just clear the list of header block pointers
@@ -312,6 +362,8 @@
     }
 
     m_attributes.clear();
+    
+    logExit()
 }
 
 

Modified: webservices/axis/trunk/c/src/soap/SoapMethod.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapMethod.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapMethod.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapMethod.cpp Thu Nov 13 14:13:23 2008
@@ -34,53 +34,79 @@
 SoapMethod::
 SoapMethod()
 {
+	logEntryEngine("SoapMethod::SoapMethod")
+
 	reset();
+	
+	logExit()
 }
 
 SoapMethod::
 ~SoapMethod()
 {
+	logEntryEngine("SoapMethod::~SoapMethod")
+
     clearAttributes();
     clearOutParams();
+    
+	logExit()
 }
 
 void SoapMethod::
 setPrefix(const AxisChar* prefix)
 {
+	logEntryEngine("SoapMethod::setPrefix")
+
 	if (NULL == prefix)
 		m_strPrefix = "";
 	else
 		m_strPrefix = prefix;
+	
+	logExit()
 }
 
 void SoapMethod::
 setLocalName(const AxisChar* localname)
 {
+	logEntryEngine("SoapMethod::setLocalName")
+
 	if (NULL == localname)
 		m_strLocalname = "";
 	else
 		m_strLocalname = localname;
+	
+	logExit()
 }
 
 void SoapMethod::
 setURI(const AxisChar* uri)
 {
+	logEntryEngine("SoapMethod::setURI")
+
 	if (NULL == uri)
 		m_strUri = "";
 	else
 		m_strUri = uri;
+	
+	logExit()
 }
 
 void SoapMethod::
 addOutputParam(Param *param)
 {
+	logEntryEngine("SoapMethod::addOutputParam")
+
     if (param)
         m_OutputParams.push_back(param);
+	
+	logExit()
 }
 
 int SoapMethod::
 serialize(SoapSerializer& pSZ)
-{    
+{   
+	logEntryEngine("SoapMethod::serialize")
+
     int iStatus= AXIS_SUCCESS;
 
     do
@@ -135,19 +161,25 @@
     } 
     while(0);
             
+	logExitWithReturnCode(iStatus)
+
     return iStatus;
 }
 
 int SoapMethod::
 serializeOutputParam(SoapSerializer& pSZ)
-{    
-    int nStatus;
+{
+	logEntryEngine("SoapMethod::serializeOutputParam")
+
+    int nStatus = AXIS_SUCCESS;
     
     for (list<Param*>::iterator it = m_OutputParams.begin(); it != m_OutputParams.end(); it++)
         if (AXIS_SUCCESS != (nStatus = (*it)->serialize(pSZ)))
-            return nStatus;
+            break;
 
-    return AXIS_SUCCESS;
+	logExitWithReturnCode(nStatus)
+
+    return nStatus;
 }
 
 const AxisChar* SoapMethod::
@@ -159,6 +191,8 @@
 bool SoapMethod::
 isSerializable()
 {
+	logEntryEngine("SoapMethod::isSerializable")
+
     bool bStatus= true;    
 
     // checking whether namespace qualified, if not return AXIS_FAIL 
@@ -177,21 +211,29 @@
     } 
     while(0);
 
+    logExitWithBoolean(bStatus)
+    
     return bStatus;
 }
 
 int SoapMethod::
 addAttribute(Attribute *pAttribute)
 {
+	logEntryEngine("SoapMethod::addAttribute")
+
 	if (pAttribute)
 		m_attributes.push_back(pAttribute);
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapMethod::
 serializeAttributes(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack)
 {
+	logEntryEngine("SoapMethod::serializeAttributes")
+
     list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
 
     while(itCurrAttribute != m_attributes.end())
@@ -200,12 +242,16 @@
         itCurrAttribute++;        
     }    
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;    
 }
 
 int SoapMethod::
 reset()
 {
+	logEntryEngine("SoapMethod::reset")
+
 	m_isWrapperStyle = true;
     m_strUri = "";
     m_strLocalname = "";
@@ -213,35 +259,45 @@
     m_OutputParams.clear();
     m_attributes.clear();
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 void SoapMethod::
 clearOutParams()
 {
-    if ( m_OutputParams.empty() )
-        return;
-        
-    list<Param*>::iterator itParam;
+	logEntryEngine("SoapMethod::clearOutParams")
+
+    if ( !m_OutputParams.empty() )
+    {
+	    list<Param*>::iterator itParam;
+	    
+	    for (itParam = m_OutputParams.begin(); itParam != m_OutputParams.end(); itParam++)
+	        delete *itParam;
+	        
+	    m_OutputParams.clear();
+    }
     
-    for (itParam = m_OutputParams.begin(); itParam != m_OutputParams.end(); itParam++)
-        delete *itParam;
-        
-    m_OutputParams.clear();
+    logExit()
 }
 
 void SoapMethod::
 clearAttributes()
 {
-    if (m_attributes.empty())
-        return;
-    
-    list<Attribute*>::iterator it;
-    
-    for (it = m_attributes.begin(); it != m_attributes.end(); ++it)
-        delete *it;
+	logEntryEngine("SoapMethod::clearAttributes")
+
+    if (!m_attributes.empty())
+    {
+	    list<Attribute*>::iterator it;
+	    
+	    for (it = m_attributes.begin(); it != m_attributes.end(); ++it)
+	        delete *it;
+	    
+	    m_attributes.clear();
+    }
     
-    m_attributes.clear();
+    logExit()
 }
 
 AXIS_CPP_NAMESPACE_END

Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapSerializer.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.cpp Thu Nov 13 14:13:23 2008
@@ -48,18 +48,25 @@
 
 AXIS_CPP_NAMESPACE_START
 
-SoapSerializer::SoapSerializer()
+SoapSerializer::
+SoapSerializer()
 {
+	logEntryEngine("SoapSerializer::SoapSerializer")
+
     m_pSoapEnvelope = NULL;
     m_iSoapVersion = SOAP_VER_1_1;
     m_pOutputStream = NULL;
     m_pNamespace = NULL;
     m_pContentIdSet = NULL;
+    
+	logExit()
 }
 
 SoapSerializer::
 ~SoapSerializer()
 {
+	logEntryEngine("SoapSerializer::~SoapSerializer")
+
     delete m_pSoapEnvelope;
 
     /* Cleaning the memory allocated to the SoapAttachments */       
@@ -78,19 +85,27 @@
         itAttRef++;
     }
     m_attachmentRefs.clear();
+    
+    logExit()
 }
 
 int SoapSerializer::
 setSoapEnvelope( SoapEnvelope * pSoapEnvelope)
 {
+	logEntryEngine("SoapSerializer::setSoapEnvelope")
+
     m_pSoapEnvelope = pSoapEnvelope;
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
 int SoapSerializer::
 setSoapHeader( SoapHeader * pSoapHeader)
 {
+	logEntryEngine("SoapSerializer::setSoapHeader")
+
     int intStatus = AXIS_FAIL;
 
     if( m_pSoapEnvelope)
@@ -104,6 +119,8 @@
             intStatus= AXIS_SUCCESS;
         }
     }
+    
+    logExitWithReturnCode(intStatus)
 
     return intStatus;
 }
@@ -111,6 +128,8 @@
 int SoapSerializer::
 setSoapBody( SoapBody * pSoapBody)
 {
+	logEntryEngine("SoapSerializer::setSoapBody")
+
     int intStatus = AXIS_FAIL;
 
     if(m_pSoapEnvelope)
@@ -119,12 +138,16 @@
         intStatus = AXIS_SUCCESS;
     }
 
+    logExitWithReturnCode(intStatus)
+
     return intStatus;
 }
 
 int SoapSerializer::
 setSoapMethod( SoapMethod *pSoapMethod)
 {
+	logEntryEngine("SoapSerializer::setSoapMethod")
+
     int intStatus = AXIS_FAIL;
 
     if( m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody))
@@ -135,12 +158,16 @@
         intStatus = AXIS_SUCCESS;
     }
 
+    logExitWithReturnCode(intStatus)
+
     return intStatus;
 }
 
 int SoapSerializer::
 addOutputBasicArrayParam( const Axis_Array * pArray, XSDTYPE nType, const AxisChar * pName)
 {
+	logEntryEngine("SoapSerializer::addOutputBasicArrayParam")
+
     int    iSuccess = AXIS_SUCCESS;
 
     Axis_Array * pLocalArray       = (Axis_Array *)NULL;
@@ -181,6 +208,8 @@
         (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
         m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam( pParam);
 
+    logExitWithReturnCode(iSuccess)
+
     return iSuccess;  
 }
 
@@ -189,6 +218,8 @@
                           void * pSZFunct, void * pDelFunct,
                           const AxisChar * pName, const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapSerializer::addOutputCmplxArrayParam")
+
     int    iSuccess = AXIS_SUCCESS;
 
     Axis_Array * pLocalArray       = (Axis_Array *)NULL;
@@ -241,6 +272,8 @@
 
     pParam->setName( pName);
 
+    logExitWithReturnCode(iSuccess)
+    
     return iSuccess;  
 }
 
@@ -249,6 +282,8 @@
                      void * pSZFunct, void * pDelFunct,
                      const AxisChar * pName, const AxisChar * pNamespace)
 { 
+	logEntryEngine("SoapSerializer::addOutputCmplxParam")
+
     int    iSuccess = AXIS_SUCCESS;
 
     Param * pParam = new Param();
@@ -264,6 +299,8 @@
 
     pParam->setName( pName);
     
+    logExitWithReturnCode(iSuccess)
+    
     return iSuccess;  
 }
 
@@ -272,6 +309,8 @@
                 void * pSZFunct, void * pDelFunct,
                 const AxisChar * pName, const AxisChar * pNamespace)
 { 
+	logEntryEngine("SoapSerializer::addFaultDetail")
+
     int    iSuccess = AXIS_SUCCESS;
     Param * pParam = new Param();
 
@@ -287,12 +326,16 @@
 
     pParam->setName( pName);
 
+    logExitWithReturnCode(iSuccess)
+    
     return iSuccess;
 }
 
 int SoapSerializer::
 addFaultDetail( const AxisChar * pDetail)
 {
+	logEntryEngine("SoapSerializer::addFaultDetail")
+
 	int iStatus = AXIS_FAIL;
     if( m_pSoapEnvelope &&
         (m_pSoapEnvelope->m_pSoapBody) && (m_pSoapEnvelope->m_pSoapBody->m_pSoapFault))
@@ -300,12 +343,16 @@
 		iStatus = m_pSoapEnvelope->m_pSoapBody->m_pSoapFault->setFaultDetail(pDetail);
 	}
 
+    logExitWithReturnCode(iStatus)
+    
 	return iStatus;
 }
 
 int SoapSerializer::
 setSoapFault( SoapFault * pSoapFault)
 {
+	logEntryEngine("SoapSerializer::setSoapFault")
+
     int intStatus = AXIS_FAIL;
 
     if( m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody))
@@ -316,12 +363,16 @@
         intStatus = AXIS_SUCCESS;
     }
 
+    logExitWithReturnCode(intStatus)
+    
     return intStatus;
 }
 
 int SoapSerializer::
 setOutputStream( SOAPTransport * pStream)
 {
+	logEntryEngine("SoapSerializer::setOutputStream")
+
     int    iStatus = AXIS_SUCCESS;
 
     m_pOutputStream = pStream;
@@ -379,7 +430,11 @@
             serialize( "<?xml version='1.0' encoding='utf-8' ?>", NULL);
 
             if( (iStatus = m_pSoapEnvelope->serialize( *this, (SOAP_VERSION) m_iSoapVersion)) == AXIS_FAIL)
+            {
+            	logThrowExceptionWithData("AxisSoapException - CLIENT_SOAP_MESSAGE_INCOMPLETE", "The SOAP serializer has detected errors in the header or envelope. Transmission has been aborted.")
+            	
                 throw AxisSoapException( CLIENT_SOAP_MESSAGE_INCOMPLETE, "The SOAP serializer has detected errors in the header or envelope. Transmission has been aborted.");
+            }
 
             if( checkAttachmentAvailability())
                 serializeAttachments( *this);
@@ -388,18 +443,28 @@
     catch( AxisSoapException& e)
     {
         e = e;
+        
+    	logRethrowException()
+
         throw;
     }
     catch( AxisException& e)
     {
         e = e;
+        
+    	logRethrowException()
+
         throw;
     }
     catch( ...)
     {
+    	logRethrowException()
+
         throw;
     }
 
+    logExitWithReturnCode(iStatus)
+
     return iStatus;
 }
 
@@ -410,7 +475,11 @@
 void SoapSerializer::
 markEndOfStream()
 {
+	logEntryEngine("SoapSerializer::markEndOfStream")
+
     m_pOutputStream->flushOutput();
+	
+    logExit()
 }
 
 /*
@@ -421,6 +490,8 @@
 int SoapSerializer::
 init()
 {
+	logEntryEngine("SoapSerializer::init")
+
     m_nStatus = AXIS_SUCCESS;
 
     delete m_pSoapEnvelope;
@@ -433,12 +504,16 @@
     m_nCounter=0;
     m_NsStack.clear();
 
+    logExitWithReturnCode(m_nStatus)
+
     return m_nStatus;
 }
 
 int SoapSerializer::
 setSoapVersion( SOAP_VERSION nSoapVersion)
 {
+	logEntryEngine("SoapSerializer::setSoapVersion")
+
     m_iSoapVersion = nSoapVersion;
 
     m_pSoapEnvelope->clearStandardNamespaceDecl(); // Samisa : AXISCPP-368
@@ -454,13 +529,19 @@
     m_NsStack[SoapKeywordMapping::map(nSoapVersion).pchNamespaceUri] = 
         SoapKeywordMapping::map(nSoapVersion).pchPrefix;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 void SoapSerializer::
 removeNamespacePrefix( const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapSerializer::removeNamespacePrefix")
+
     if( m_NsStack.find( pNamespace) != m_NsStack.end())
         m_NsStack.erase( pNamespace);
+	
+	logExit()
 }
 
 const AxisChar * SoapSerializer::
@@ -494,6 +575,8 @@
 IWrapperSoapSerializer& SoapSerializer::
 operator << (const AxisChar * cSerialized)
 {
+	logSetFunctionNameEngine("SoapSerializer::operator <<")
+
 	// some thing has gone wrong. So do nothing 
     if( AXIS_SUCCESS != m_nStatus) 
         return *this;
@@ -506,24 +589,34 @@
     catch(AxisSoapException& e)
     {
         e = e;
+        
+    	logRethrowException()
+
         throw;
     }
     catch(AxisException& e)
     {
         e = e;
+        
+    	logRethrowException()
+
         throw;
     }
     catch(...)
     {
+    	logRethrowException()
+
         throw;
     }
-
+    
     return *this;
 }
 
 int SoapSerializer::
 createSoapMethod( const AxisChar * sLocalName, const AxisChar * sURI)
 {
+	logEntryEngine("SoapSerializer::createSoapMethod")
+
 	if (NULL == m_pSoapEnvelope || NULL == m_pSoapEnvelope->m_pSoapBody)
 		return AXIS_FAIL;
 		
@@ -541,6 +634,8 @@
     pMethod->setPrefix( getNamespacePrefix( sURI));
     pMethod->setURI( sURI);
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
@@ -550,6 +645,8 @@
                  const AxisChar * sFaultCode,
                  const AxisChar * sFaultString)
 {
+	logEntryEngine("SoapSerializer::createSoapFault")
+
     SoapFault * pSoapFault = new SoapFault();
 
     setSoapFault( pSoapFault);
@@ -567,6 +664,8 @@
     strUrl += string( pcPort);
     pSoapFault->setFaultactor( strUrl.c_str());
     
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
@@ -577,11 +676,15 @@
 ArrayBean * SoapSerializer::
 makeArrayBean( XSDTYPE nType, void ** pArray)
 {
+	logEntryEngine("SoapSerializer::makeArrayBean")
+
     ArrayBean* pAb = new ArrayBean();
 
     pAb->m_type = nType;
     pAb->m_value.sta = pArray;
 
+    logExitWithPointer(pAb)
+
     return pAb;
 }
 
@@ -592,6 +695,8 @@
 ArrayBean * SoapSerializer::
 makeArrayBean(void ** pObject, void * pSZFunct, void * pDelFunct)
 {
+	logEntryEngine("SoapSerializer::makeArrayBean")
+
     ArrayBean* pAb = new ArrayBean();
 
     pAb->m_type = USER_TYPE;
@@ -600,22 +705,30 @@
     pAb->m_value.cta->pDelFunct = (AXIS_OBJECT_DELETE_FUNCT) pDelFunct;
     pAb->m_value.cta->pObject = pObject;
 
+    logExitWithPointer(pAb)
+
     return pAb;
 }
 
 IHeaderBlock * SoapSerializer::
 createHeaderBlock()
 {
+	logEntryEngine("SoapSerializer::createHeaderBlock")
+
     HeaderBlock * pHeaderBlock= new HeaderBlock();
 
     setHeaderBlock( pHeaderBlock);
 
+    logExitWithPointer(pHeaderBlock)
+
     return pHeaderBlock;
 }
 
 int SoapSerializer::
 setHeaderBlock( HeaderBlock * pHeaderBlock)
 {
+	logEntryEngine("SoapSerializer::setHeaderBlock")
+
     int intStatus = AXIS_FAIL;
 
     if( (m_pSoapEnvelope) && (m_pSoapEnvelope->m_pSoapHeader))
@@ -631,6 +744,8 @@
     m_pSoapEnvelope->m_pSoapHeader->addHeaderBlock( pHeaderBlock);
     intStatus = AXIS_SUCCESS;
 
+    logExitWithReturnCode(intStatus)
+
     return intStatus;
 }
 
@@ -643,9 +758,13 @@
 int SoapSerializer::
 removeSoapHeader()
 {
+	logEntryEngine("SoapSerializer::removeSoapHeader")
+
     delete m_pSoapEnvelope->m_pSoapHeader;
     m_pSoapEnvelope->m_pSoapHeader= NULL;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
@@ -658,6 +777,8 @@
                      void * pSZFunct, void * pDelFunct, 
                      const AxisChar * pName, const AxisChar * pNamespace)
 {
+	logEntryEngine("SoapSerializer::serializeCmplxArray")
+
     ArrayBean  * pAb = (ArrayBean *)NULL;
     
     // We need to handle NULL array passed in which means serialize empty array.
@@ -711,6 +832,8 @@
     pAb->RemoveArrayPointer();
     delete pParam;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
@@ -733,6 +856,8 @@
 serializeBasicArray(const Axis_Array* pArray, 
                     const AxisChar* pNamespace, XSDTYPE nType, const AxisChar* pName)
 {
+	logEntryEngine("SoapSerializer::serializeBasicArray")
+
     ArrayBean  * pAb = (ArrayBean *)NULL;
     
     // We need to handle NULL array passed in which means serialize empty array.
@@ -783,6 +908,8 @@
     pAb->RemoveArrayPointer();
     delete pParam;
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
@@ -801,30 +928,34 @@
 int SoapSerializer::
 addOutputParam( const AxisChar * pchName, void * pValue, XSDTYPE type)
 {
+	logEntryEngine("SoapSerializer::addOutputParam")
+
     IAnySimpleType* xsdValue = AxisUtils::createSimpleTypeObject(pValue, type);
     
     Param * pParam = new Param();
 
-    if( !pParam)
-        return AXIS_FAIL;
-
-    pParam->m_Type = type;
-    pParam->m_sName = pchName;
-
-
-    pParam->setValue(type, xsdValue);
+    int iStatus = AXIS_FAIL;
     
-    if( m_pSoapEnvelope &&
-        (m_pSoapEnvelope->m_pSoapBody) &&
-        (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
-        m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam( pParam);
-    else
+    if( pParam)
     {
-        delete pParam;
-        return AXIS_FAIL;
+	    pParam->m_Type = type;
+	    pParam->m_sName = pchName;
+	    pParam->setValue(type, xsdValue);
+	    
+	    if( m_pSoapEnvelope &&
+	        (m_pSoapEnvelope->m_pSoapBody) &&
+	        (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
+	    {
+	        m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam( pParam);
+	        iStatus = AXIS_SUCCESS;
+	    }
+	    else
+	        delete pParam;
     }
 
-    return AXIS_SUCCESS;  
+    logExitWithReturnCode(iStatus)
+
+    return iStatus;  
 }
 
 int SoapSerializer::serializeAsElement( const AxisChar * pName,
@@ -842,7 +973,6 @@
     IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(pValue, type);
     int ret;
     ret = serializeAsElement(pName, pNamespace, pSimpleType);
-    // got to clean memory allocated in AxisUtils::createSimpleTypeObject
     delete pSimpleType;
 
     return ret;
@@ -853,10 +983,15 @@
     return serializeAsElement( pName, NULL, pSimpleType);
 }
 
-int SoapSerializer::serializeAsElement( const AxisChar * pName, 
-                                        const AxisChar * pNamespace,
-                                        IAnySimpleType * pSimpleType) 
+int SoapSerializer::
+serializeAsElement( const AxisChar * pName, 
+                    const AxisChar * pNamespace,
+                    IAnySimpleType * pSimpleType) 
 {
+	logEntryEngine("SoapSerializer::serializeAsElement")
+
+    int iStatus = AXIS_FAIL;
+
     const AxisChar* pPrefix = NULL;
     bool blnIsNewPrefix = false;
 
@@ -876,10 +1011,12 @@
     if( pSerialized)
     {
         *this << pSerialized;
-        return AXIS_SUCCESS;  
+        iStatus = AXIS_SUCCESS;  
     }
 
-    return AXIS_FAIL;  // Can it only be unsuccessful?
+    logExitWithReturnCode(iStatus)
+
+    return iStatus;
 } 
 
 int SoapSerializer::serializeAsAttribute( const AxisChar * pName,
@@ -895,10 +1032,15 @@
     return status;
 }
 
-int SoapSerializer::serializeAsAttribute( const AxisChar * pName, 
-                                          const AxisChar * pNamespace, 
-                                          IAnySimpleType* pSimpleType)
+int SoapSerializer::
+serializeAsAttribute( const AxisChar * pName, 
+                      const AxisChar * pNamespace, 
+                      IAnySimpleType* pSimpleType)
 {
+	logEntryEngine("SoapSerializer::serializeAsAttribute")
+
+    int iStatus = AXIS_FAIL;
+
     const AxisChar * pPrefix = NULL;
 
     if( pNamespace)
@@ -909,14 +1051,19 @@
     if( pSerialized)
     {
         *this << pSerialized;
-        return AXIS_SUCCESS;   
+        iStatus = AXIS_SUCCESS;   
     }
 
-    return AXIS_FAIL;  // Can it only be unsuccessful?
+    logExitWithReturnCode(iStatus)
+
+    return iStatus; 
 }
 
-void SoapSerializer::serializeVargs( const char * pFirst, va_list vList)
+void SoapSerializer::
+serializeVargs( const char * pFirst, va_list vList)
 {
+	logEntryEngine("SoapSerializer::serializeVargs")
+
     const char * pArg;
     
     if( pFirst)
@@ -930,33 +1077,46 @@
             *this << pArg;
     } 
     while( pArg != NULL);
+    
+    logExit()
 }
 
-void SoapSerializer::serialize( const char * pFirst, ...)
+void SoapSerializer::
+serialize( const char * pFirst, ...)
 {
+	logEntryEngine("SoapSerializer::serialize")
+
     va_list vList;
 
     va_start( vList, pFirst );   
     serializeVargs(pFirst, vList);
-    va_end( vList);         
+    va_end( vList);  
+    
+    logExit()
 }
 
 /*
  * Used probably by a handler to add a header block to the Serializer. 
  */
-int SoapSerializer::addHeaderBlock( IHeaderBlock * pBlk)
+int SoapSerializer::
+addHeaderBlock( IHeaderBlock * pBlk)
 {
+	logEntryEngine("SoapSerializer::addHeaderBlock")
+
+	int iStatus = AXIS_FAIL;
+	
     if( m_pSoapEnvelope)
     {
         if( !m_pSoapEnvelope->m_pSoapHeader)
             m_pSoapEnvelope->m_pSoapHeader = new SoapHeader();
+        
+        m_pSoapEnvelope->m_pSoapHeader->addHeaderBlock( (HeaderBlock *) pBlk);
+        iStatus = AXIS_SUCCESS;
     }
-    else /* error : by this time there should be an envelope */
-        return AXIS_FAIL;
 
-    m_pSoapEnvelope->m_pSoapHeader->addHeaderBlock( (HeaderBlock *) pBlk);
+    logExitWithReturnCode(iStatus)
 
-    return AXIS_SUCCESS;  
+    return iStatus;  
 }
 
 int SoapSerializer::setBodyAsHexBinary( xsd__hexBinary body)
@@ -1008,59 +1168,86 @@
     serialize( "</", pName, ">", NULL);
 }
 
-IHeaderBlock * SoapSerializer::createHeaderBlock( const AxisChar * pachLocalName, 
-                                                  const AxisChar * pachUri)
+IHeaderBlock * SoapSerializer::
+createHeaderBlock( const AxisChar * pachLocalName, 
+                   const AxisChar * pachUri)
 {
+	logEntryEngine("SoapSerializer::createHeaderBlock")
+
     HeaderBlock * pHeaderBlock= new HeaderBlock( pachLocalName, pachUri);
 
     setHeaderBlock( pHeaderBlock);
 
+    logExitWithPointer(pHeaderBlock)
+
     return pHeaderBlock;    
 }
 
-SoapMethod * SoapSerializer::getSOAPMethod()
+SoapMethod * SoapSerializer::
+getSOAPMethod()
 {
-    if ( m_pSoapEnvelope &&
-        (m_pSoapEnvelope->m_pSoapBody))
-    	return m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod;
+	logEntryEngine("SoapSerializer::getSOAPMethod")
+
+	SoapMethod * returnValue = NULL;
 	
-    return NULL;
+    if ( m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody))
+    	returnValue = m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod;
+	
+    logExitWithPointer(returnValue)
+    
+    return returnValue;
 }
 
 int SoapSerializer::
 setSOAPMethodAttribute( Attribute * pAttribute)
 {
+	logEntryEngine("SoapSerializer::setSOAPMethodAttribute")
+	
+	int iStatus = AXIS_FAIL;
+
     if( m_pSoapEnvelope &&
         (m_pSoapEnvelope->m_pSoapBody) &&
         (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod))
     {
         m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addAttribute( pAttribute);
 
-        return AXIS_SUCCESS;  
+        iStatus = AXIS_SUCCESS;  
     }
 
-    return AXIS_FAIL;
+    logExitWithReturnCode(iStatus)
+
+    return iStatus;
 }
 void SoapSerializer::
 clearSOAPMethodAttributes()
 {
+	logEntryEngine("SoapSerializer::clearSOAPMethodAttributes")
+
     if (m_pSoapEnvelope && m_pSoapEnvelope->m_pSoapBody
             && m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)
         m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->clearAttributes();
+	
+	logExit()
 }
 
 int SoapSerializer::
 serializeAnyObject( AnyType * pAnyObject)
 {
+	logEntryEngine("SoapSerializer::serializeAnyObject")
+
     for( int i = 0; i < pAnyObject->_size; i++)
         serialize( pAnyObject->_array[i], 0);
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
 int SoapSerializer::
 addOutputAnyObject( AnyType * pAnyObject)
 {
+	logEntryEngine("SoapSerializer::addOutputAnyObject")
+
     Param * pParam = new Param();
 
     pParam->m_Type = XSD_ANY;
@@ -1071,18 +1258,26 @@
         (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod))
         m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam( pParam);
 
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
-IHeaderBlock * SoapSerializer::getHeaderBlock( const AxisChar * pcName, 
-                                               const AxisChar * pcNamespace)
+IHeaderBlock * SoapSerializer::
+getHeaderBlock( const AxisChar * pcName, 
+                const AxisChar * pcNamespace)
 {
+	logEntryEngine("SoapSerializer::getHeaderBlock")
+ 
+    IHeaderBlock * returnValue = NULL;
+	
     // there has been no <Header> element so there can be no Header blocks	
-    if( (!m_pSoapEnvelope) ||
-        (!m_pSoapEnvelope->m_pSoapHeader))
-        return NULL; 
+    if (m_pSoapEnvelope && m_pSoapEnvelope->m_pSoapHeader)
+    	returnValue = m_pSoapEnvelope->m_pSoapHeader->getHeaderBlock( pcName, pcNamespace, false);
+    
+    logExitWithPointer(returnValue)
 
-    return m_pSoapEnvelope->m_pSoapHeader->getHeaderBlock( pcName, pcNamespace, false);
+    return returnValue;
 }
 
 IHeaderBlock * SoapSerializer::getFirstHeaderBlock()
@@ -1095,8 +1290,11 @@
     return m_pSoapEnvelope->m_pSoapHeader->getNextHeaderBlock();
 }
 
-int SoapSerializer::serializeAsChardata( void * pValue, XSDTYPE type)
+int SoapSerializer::
+serializeAsChardata( void * pValue, XSDTYPE type)
 {
+	logEntryEngine("SoapSerializer::serializeAsChardata")
+
     char * pStr = m_Buf;
 
     IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(pValue, type);
@@ -1106,11 +1304,16 @@
 
     delete pSimpleType;
     
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;  
 }
 
-void SoapSerializer::serializeAttachments( SoapSerializer &pSZ)
+void SoapSerializer::
+serializeAttachments( SoapSerializer &pSZ)
 {
+	logEntryEngine("SoapSerializer::serializeAttachments")
+
     /*serializing the attachments*/
     map<AxisXMLString, ISoapAttachment*>::iterator itCurrAttach= m_SoapAttachments.begin();
     while( itCurrAttach != m_SoapAttachments.end())
@@ -1124,14 +1327,18 @@
         itCurrAttach++;
     }
     pSZ.serialize("\r\n--" MIMEBOUNDARY "--\r\n", NULL);
+    
+    logExit()
 }
 
-void SoapSerializer::addAttachment( const AxisChar * achId, ISoapAttachment * pAttach)
+void SoapSerializer::
+addAttachment( const AxisChar * achId, ISoapAttachment * pAttach)
 {
     m_SoapAttachments[achId] = pAttach;
 }
 
-void SoapSerializer::addAttachments(ISoapAttachment** pAttach, int iAttchArraySize)
+void SoapSerializer::
+addAttachments(ISoapAttachment** pAttach, int iAttchArraySize)
 {   
      for (int i=0; i < iAttchArraySize; i++)
     {
@@ -1141,9 +1348,10 @@
  
 }
 
-void SoapSerializer::addAttachmentHeader(const AxisChar * achId,
-                                         const AxisChar * achHeaderName,
-                                         const AxisChar * achHeaderValue)
+void SoapSerializer::
+addAttachmentHeader(const AxisChar * achId,
+                    const AxisChar * achHeaderName,
+                    const AxisChar * achHeaderValue)
 {
 
     if (m_SoapAttachments[achId] == NULL)
@@ -1152,8 +1360,9 @@
     m_SoapAttachments[achId]->addHeader( achHeaderName, achHeaderValue);
 }
 
-void SoapSerializer::addAttachmentBody( const AxisChar * achId,
-                                        xsd__base64Binary * pAttchBody)
+void SoapSerializer::
+addAttachmentBody( const AxisChar * achId,
+                   xsd__base64Binary * pAttchBody)
 {
     if( m_SoapAttachments[achId] == NULL)
         m_SoapAttachments[achId] = new SoapAttachment(m_pContentIdSet);        
@@ -1161,18 +1370,20 @@
     m_SoapAttachments[achId]->addBody( pAttchBody);
 }
 
-void SoapSerializer::addNamespaceToEnvelope( AxisChar * pachNamespaceURI,
-                                             AxisChar * pachPrefix)
+void SoapSerializer::
+addNamespaceToEnvelope( AxisChar * pachNamespaceURI,
+                        AxisChar * pachPrefix)
 {
-        std::list<Attribute*> attributeList;
-    Attribute * pNameSpace = new Attribute( attributeList,
-                                            pachPrefix,
-                                            "xmlns",
-                                            pachNamespaceURI);
+	logEntryEngine("SoapSerializer::addNamespaceToEnvelope")
+
+    std::list<Attribute*> attributeList;
+    Attribute * pNameSpace = new Attribute( attributeList, pachPrefix, "xmlns", pachNamespaceURI);
 
     m_pSoapEnvelope->addNamespaceDecl( pNameSpace);
 
     addNamespaceToNamespaceList( pachNamespaceURI, pachPrefix);
+    
+    logExit()
 }
 
 void SoapSerializer::addNamespaceToNamespaceList( const AxisChar * pachNamespaceURI,
@@ -1296,7 +1507,8 @@
 int SoapSerializer::
 deleteHeaderBlock( const AxisChar * pName, const AxisChar * pNamespace)
 {
-   
+	logEntryEngine("SoapSerializer::deleteHeaderBlock")
+
     int iStatus = AXIS_SUCCESS;
 
     iStatus = m_pSoapEnvelope->m_pSoapHeader->deleteHeaderBlock( pName, pNamespace);
@@ -1309,11 +1521,16 @@
         iStatus = AXIS_SUCCESS;
     }
 
+    logExitWithReturnCode(iStatus)
+
     return iStatus; 
 }
 
-void SoapSerializer::reset()
+void SoapSerializer::
+reset()
 {
+	logEntryEngine("SoapSerializer::reset")
+
     m_nCounter = 0; // reset namespace prifix counter 
 
     if( m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody) && (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod))
@@ -1321,6 +1538,8 @@
 
     if( m_pSoapEnvelope && m_pSoapEnvelope->m_pSoapHeader )
         m_pSoapEnvelope->m_pSoapHeader->clear();
+    
+    logExit()
 }
 
 AXIS_CPP_NAMESPACE_END



Mime
View raw message