You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/01/04 04:13:39 UTC

svn commit: r608722 - in /webservices/axis/trunk/c/src/soap: SoapBody.cpp SoapMethod.h SoapSerializer.cpp

Author: nadiramra
Date: Thu Jan  3 19:13:37 2008
New Revision: 608722

URL: http://svn.apache.org/viewvc?rev=608722&view=rev
Log:
AXISCPP-429 - stubs use request message name, instead of operation name for setOperation

Modified:
    webservices/axis/trunk/c/src/soap/SoapBody.cpp
    webservices/axis/trunk/c/src/soap/SoapMethod.h
    webservices/axis/trunk/c/src/soap/SoapSerializer.cpp

Modified: webservices/axis/trunk/c/src/soap/SoapBody.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapBody.cpp?rev=608722&r1=608721&r2=608722&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapBody.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapBody.cpp Thu Jan  3 19:13:37 2008
@@ -84,10 +84,16 @@
         }
         else if(NULL != m_pSoapMethod)
         {
-            iStatus= m_pSoapMethod->serialize(pSZ);
-            if(iStatus==AXIS_FAIL)
-                break;
-        } 
+        	// A null-string namespace means the operation does not have input parameters and
+        	// thus we skip this serialization step!
+        	AxisString prefix = m_pSoapMethod->getPrefix();
+        	if (prefix.length() != 0)
+        	{
+        		iStatus= m_pSoapMethod->serialize(pSZ);
+        		if(iStatus==AXIS_FAIL)
+        			break;
+        	}
+        }
         else
         {
             m_pSoapFault = SoapFault::getSoapFault(SERVER_ENGINE_WEBSERVICE_FAILED);

Modified: webservices/axis/trunk/c/src/soap/SoapMethod.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapMethod.h?rev=608722&r1=608721&r2=608722&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapMethod.h (original)
+++ webservices/axis/trunk/c/src/soap/SoapMethod.h Thu Jan  3 19:13:37 2008
@@ -93,6 +93,9 @@
     
     /** Method to clear up all the current attributes in preparation of a new method call */
     void clearAttributes();
+    
+    /** Return namespace prefix */
+    AxisString getPrefix() { return m_strPrefix; }
 };
 
 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=608722&r1=608721&r2=608722&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.cpp Thu Jan  3 19:13:37 2008
@@ -455,19 +455,20 @@
 const AxisChar * SoapSerializer::
 getNamespacePrefix( const AxisChar * pNamespace)
 {
-    if( m_NsStack.find( pNamespace) == m_NsStack.end())
-    {
-        m_nCounter++;
-        AxisSprintf(m_Buf, 8, "ns%d", m_nCounter);
-        m_NsStack[pNamespace] = m_Buf;
-    }
-
-    return m_NsStack[pNamespace].c_str();
+	bool blnIsNewPrefix;
+	return getNamespacePrefix(pNamespace, blnIsNewPrefix);
 }
 
 const AxisChar * SoapSerializer::
 getNamespacePrefix( const AxisChar * pNamespace, bool & blnIsNewPrefix)
 {
+	blnIsNewPrefix = false;
+	
+	// We will not map null or null string namespaces...MUST return null string
+	// since the namespace is sometimes assigned to object of type string class.
+	if (pNamespace == (const AxisChar *)NULL || pNamespace[0] == '\0')	
+		return (const AxisChar *)"";
+	
     if( m_NsStack.find( pNamespace) == m_NsStack.end())
     {
         m_nCounter++;



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