axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r902922 - in /webservices/axis/trunk/c/src: soap/SoapDeSerializer.cpp wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
Date Mon, 25 Jan 2010 18:54:22 GMT
Author: nadiramra
Date: Mon Jan 25 18:54:22 2010
New Revision: 902922

URL: http://svn.apache.org/viewvc?rev=902922&view=rev
Log:
AXISCPP-1064 Parser gets confused when expected element is not there

Modified:
    webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java

Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=902922&r1=902921&r2=902922&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Mon Jan 25 18:54:22 2010
@@ -947,6 +947,17 @@
 
     if (!isFault)
     {
+    	if (AXIS_SUCCESS == m_nStatus && (RPC_ENCODED != m_nStyle) && (m_pNode
== NULL))
+    	{
+    		const char*name = peekNextElementName();
+    		if (0 != strcmp (pName, name))
+    		{
+                logExitWithPointer(NULL)
+
+                return NULL; 
+    		}
+    	}
+    	
         if (AXIS_SUCCESS != m_nStatus || (AXIS_FAIL == getNextNode(RPC_ENCODED != m_nStyle)))
         {
             logExitWithPointer(NULL)
@@ -1475,6 +1486,17 @@
         return;
     }
         
+	if ((RPC_ENCODED != m_nStyle) && (m_pNode == NULL))
+	{
+		const char*name = peekNextElementName();
+		if (0 != strcmp (pName, name))
+		{
+            logExit()
+
+            return; 
+		}
+	}
+    
     if (AXIS_FAIL == getNextNode(RPC_ENCODED != m_nStyle))
     {
         logExit()

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=902922&r1=902921&r2=902922&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
Mon Jan 25 18:54:22 2010
@@ -640,16 +640,6 @@
             {                
                 String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamNameAsSOAPString()
: attribs[i].getElementNameAsSOAPString());
                 
-                // We only peek for elements, not element attributes!
-                if (attribs[i].isOptional() && !attribs[i].isAttribute() &&
!handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "peekedElementName = axiscSoapDeSerializerPeekNextElementName(pDZ);\n");
-                    c_writer.write(tab1 + "if (strcmp(peekedElementName, \"" + soapTagName
+ "\") == 0)\n");
-                    c_writer.write(tab1 + "{\n");
-                    
-                    tab2 += "\t";
-                }
-                
                 Type type = attribs[i].getType();
                 boolean isPointerType = false;
                 if (type.isSimpleType())
@@ -701,39 +691,18 @@
                     
                     c_writer.write(tab2 + "}\n");  // end local scope                
                 }
-                
-                if (attribs[i].isOptional() && !attribs[i].isAttribute() &&
!handleAll && !handleChoice)
-                {
-                    c_writer.write("\t\t\t}\n");
-                    c_writer.write("\t\telse\n");
-                    c_writer.write("\t\t\tparam->" + attribs[i].getParamNameAsMember()
+ " = NULL;\n");
-                }
             }
             else
             {
                 //if complex type
                 String soapTagName = attribs[i].getParamNameAsSOAPString();
-                
-                if (attribs[i].isOptional() && !handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "peekedElementName = axiscSoapDeSerializerPeekNextElementName(pDZ);\n");
-                    c_writer.write(tab1 + "if (strcmp(peekedElementName, \"" + soapTagName
+ "\") == 0)\n");
-                    
-                    tab2 += "\t";
-                }
 
                 c_writer.write(tab2 + "param->" + attribs[i].getParamNameAsMember() 
                         + " = ("  + attribs[i].getTypeName()
                         + "*)axiscSoapDeSerializerGetCmplxObject(pDZ,(void*)Axis_DeSerialize_"
+ attribs[i].getTypeName()
                         + ", (void*)Axis_Create_" + attribs[i].getTypeName() 
                         + ", (void*)Axis_Delete_" + attribs[i].getTypeName() 
-                        + ", \"" + soapTagName + "\", Axis_URI_" + attribs[i].getTypeName()
+ ");\n");
-                
-                if (attribs[i].isOptional()  && !handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "else\n");
-                    c_writer.write(tab1 + "\tparam->" + attribs[i].getParamNameAsMember()
+ " = NULL;\n");
-                }      
+                        + ", \"" + soapTagName + "\", Axis_URI_" + attribs[i].getTypeName()
+ ");\n");   
             }
 
             if (attribs[i].getChoiceElement() || attribs[i].getAllElement())

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=902922&r1=902921&r2=902922&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
Mon Jan 25 18:54:22 2010
@@ -864,16 +864,6 @@
             {
                 String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamNameAsSOAPString()
: attribs[i].getElementNameAsSOAPString());
                 
-                // We only peek for elements, not element attributes!
-                if (attribs[i].isOptional() && !attribs[i].isAttribute() &&
!handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "peekedElementName = pIWSDZ->peekNextElementName();\n");
-                    c_writer.write(tab1 + "if (strcmp(peekedElementName, \"" + soapTagName
+ "\") == 0)\n");
-                    c_writer.write(tab1 + "{\n");
-                    
-                    tab2 += "\t";
-                }
-                
                 Type type = attribs[i].getType();
                 boolean isPointerType = false;
                 if (type.isSimpleType())
@@ -923,27 +913,11 @@
                             + ", " + CUtils.getXSDEnumeratorForType( attribs[i].getTypeName())
+ ");\n");
                     c_writer.write(tab2 + "}\n");                        
                 }
-                
-                // TODO - remove this chunk of code...?
-                if (attribs[i].isOptional() && !attribs[i].isAttribute() &&
!handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "}\n");
-                    c_writer.write(tab1 + "else\n");
-                    c_writer.write(tab1 + "\tparam->" + attribs[i].getParamNameAsMember()
+ " = NULL;\n");
-                }
             }
             else
             {
                 //if complex type
                 String soapTagName = attribs[i].getParamNameAsSOAPString();
-                
-                if (attribs[i].isOptional() && !handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "peekedElementName = pIWSDZ->peekNextElementName();\n");
-                    c_writer.write(tab1 + "if (strcmp(peekedElementName, \"" + soapTagName
+ "\") == 0)\n");
-                    
-                    tab2 += "\t";
-                }
 
                 c_writer.write(tab2 + "param->" + attribs[i].getParamNameAsMember()
                         + " = (" + attribs[i].getTypeName()
@@ -951,13 +925,6 @@
                         + ", (void*)Axis_Create_" + attribs[i].getTypeName() 
                         + ", (void*)Axis_Delete_" + attribs[i].getTypeName() 
                         + ", \"" + soapTagName + "\", Axis_URI_" + attribs[i].getTypeName()
+ ");\n");
-                
-                // TODO remove following chunk of code...?
-                if (attribs[i].isOptional() && !handleAll && !handleChoice)
-                {
-                    c_writer.write(tab1 + "else\n");
-                    c_writer.write(tab1 + "\tparam->" + attribs[i].getParamNameAsMember()
+ " = NULL;\n");
-                }
             }
 
             if (attribs[i].getChoiceElement() || attribs[i].getAllElement())



Mime
View raw message