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 2006/12/26 03:48:34 UTC

svn commit: r490208 - /webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp

Author: nadiramra
Date: Mon Dec 25 18:48:33 2006
New Revision: 490208

URL: http://svn.apache.org/viewvc?view=rev&rev=490208
Log:
AXISCPP-1011 - faultactor and detail elements are not mandatory.

Modified:
    webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp

Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?view=diff&rev=490208&r1=490207&r2=490208
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Mon Dec 25 18:48:33 2006
@@ -386,6 +386,7 @@
     char *pcFaultCode;
     char *pcFaultstring;
     char *pcFaultactor;
+    
     if (0 == strcmp ("Fault", pName))
     {
         if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
@@ -407,35 +408,39 @@
         setStyle (DOC_LITERAL);
         pcFaultCode = getElementAsString ("faultcode", 0);
         pFault->setFaultcode (pcFaultCode == NULL ? "" : pcFaultCode);
-        if ( pcFaultCode )
-            delete [] pcFaultCode;
+        delete [] pcFaultCode;
         
         pcFaultstring = getElementAsString ("faultstring", 0);
         pFault->setFaultstring (pcFaultstring == NULL ? "" : pcFaultstring);
-        if ( pcFaultstring )
-            delete [] pcFaultstring;
+        delete [] pcFaultstring;
      
-        pcFaultactor = getElementAsString ("faultactor", 0);
-        pFault->setFaultactor (pcFaultactor == NULL ? "" : pcFaultactor);
-        if ( pcFaultactor )
+        // faultactor is optional
+        const char* elementName = peekNextElementName();
+        if (strcmp(elementName, "faultactor") == 0)
+        {
+            pcFaultactor = getElementAsString ("faultactor", 0);
+            pFault->setFaultactor (pcFaultactor == NULL ? "" : pcFaultactor);
             delete [] pcFaultactor;
-    
+        }      
+         
+        // detail is optional.   
         // FJP Changed the namespace from null to a single space (an impossible
         //     value) to help method know that it is parsing a fault message.
-        pcDetail = getElementAsString ("detail", " ");
-        
-        if (pcDetail)
-        {
-            pFault->setFaultDetail (pcDetail);
-            delete [] pcDetail;          
-        }
-        else
+        elementName = peekNextElementName();
+        if (strcmp(elementName, "detail") == 0)
         {
-            pcCmplxFaultName = getCmplxFaultObjectName ();
-            pFault->setCmplxFaultObjectName (pcCmplxFaultName == NULL ? "" : pcCmplxFaultName);
-            /*    if ( pcCmplxFaultName )
-                    delete [] (reinterpret_cast <char *> (pcCmplxFaultName) );
-            */
+            pcDetail = getElementAsString ("detail", " ");
+            
+            if (pcDetail)
+            {
+                pFault->setFaultDetail (pcDetail);
+                delete [] pcDetail;          
+            }
+            else
+            {
+                pcCmplxFaultName = getCmplxFaultObjectName ();
+                pFault->setCmplxFaultObjectName (pcCmplxFaultName == NULL ? "" : pcCmplxFaultName);
+            }
         }
     
         setStyle (m_nStyle);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org