axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r370475 - in /webservices/axis/trunk/c: src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ tests/auto_build/testcases/client/cpp/
Date Thu, 19 Jan 2006 14:23:35 GMT
Author: dicka
Date: Thu Jan 19 06:23:27 2006
New Revision: 370475

URL: http://svn.apache.org/viewcvs?rev=370475&view=rev
Log:
Resolve problems with generated code for WSDLs containing xsd:choice with array (maxOccurs>1)
elements.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedChoiceClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedStringChoiceClient.cpp

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=370475&r1=370474&r2=370475&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Thu Jan 19 06:23:27 2006
@@ -168,14 +168,19 @@
                 
                 if (attribs[i].isArray())
                 {
-                    writer.write("\n" + properParamName + " * " + classname
+                    String parameterTypeName = properParamName;
+                    if (!parameterTypeName.endsWith("*"))
+                    {
+                        parameterTypeName += " *";
+                    }
+                    writer.write("\n" + parameterTypeName + " " + classname
                             + "::get" + methodName + "()\n{\n");
 
                     writer.write("\t" + "return " + parameterName + " ; \n}\n");
 
                     writer.write("\n" + "void " + classname + "::set"
-                            + methodName + "(" + properParamName
-                            + " * pInValue)\n{\n");
+                            + methodName + "(" + parameterTypeName
+                            + " pInValue)\n{\n");
 
                     writer.write("\tif(" + parameterName + " == NULL)\n");
                     writer.write("\t{\n");
@@ -649,28 +654,16 @@
                 //if Array
                 if (attribs[i].isSimpleType())
                 {
-                	if (attribs[i].getChoiceElement()||attribs[i].getAllElement())
-                		writer.write("\tpSZ->serializeBasicArray(*(param->"
-                                + attribs[i].getParamName()
-                                + "), "
-                                + namespace
-                                + ","
-                                + CUtils.getXSDTypeForBasicType(attribs[i]
-                                                .getTypeName())
-                                + ", \""
-                                + attribs[i].getParamNameAsSOAPElement()
-                                + "\");\n");
-                	else
-                		writer.write("\tpSZ->serializeBasicArray(param->"
-                            + attribs[i].getParamName()
-                            + ", "
-                            + namespace
-                            + ","
-                            + CUtils.getXSDTypeForBasicType(attribs[i]
-                                            .getTypeName())
-                            + ", \""
-                            + attribs[i].getParamNameAsSOAPElement()
-                            + "\");\n");
+            		writer.write("\tpSZ->serializeBasicArray(param->"
+                        + attribs[i].getParamName()
+                        + ", "
+                        + namespace
+                        + ","
+                        + CUtils.getXSDTypeForBasicType(attribs[i]
+                                        .getTypeName())
+                        + ", \""
+                        + attribs[i].getParamNameAsSOAPElement()
+                        + "\");\n");
                 }
                 else
                 {
@@ -952,15 +945,9 @@
                             + "\",0);\n");
                     writer.write("\tif(param->" + attribs[i].getParamNameAsMember() +
" == NULL)\n");
                     writer.write("\t{\n");
-                    if (attribs[i].getChoiceElement()||attribs[i].getAllElement())
-                    	writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() +
" = new " + attribs[i].getTypeName() + "_Array*();\n");
-                    else
-                    	writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() +
" = new " + attribs[i].getTypeName() + "_Array();\n");
+                	writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + " =
new " + attribs[i].getTypeName() + "_Array();\n");
                     writer.write("\t}\n");
-                    if (attribs[i].getChoiceElement()||attribs[i].getAllElement())
-                    	writer.write("\t(*(param->" + attribs[i].getParamNameAsMember() +
"))->clone(*array" + arrayCount + ");\n");
-                    else
-                    	writer.write("\tparam->" + attribs[i].getParamNameAsMember() + "->clone(
*array" + arrayCount + ");\n");
+                	writer.write("\tparam->" + attribs[i].getParamNameAsMember() + "->clone(
*array" + arrayCount + ");\n");
                     writer.write("\tAxis::AxisDelete((void*) array" + arrayCount + ", XSD_ARRAY);\n\n");
                 }
                 else

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=370475&r1=370474&r2=370475&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
Thu Jan 19 06:23:27 2006
@@ -317,9 +317,14 @@
 					{
 					    if( attribs[i].isArray())
 					    {
+					        String paramName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
+					        if (!paramName.endsWith("*"))
+					        {
+					            paramName += " *";
+					        }
 							writer.write("\tclass "
-									 + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-									 + " * " + attribs[i].getParamName()
+									 + paramName
+									 + " " + attribs[i].getParamName()
 									 + ";\n");
 					        
 					    }
@@ -439,10 +444,15 @@
 					{
 						if(attribs[i].getAllElement() || attribs[i].getChoiceElement())
 						{
+						    String paramName = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
+						    if (!paramName.endsWith("*"))
+						    {
+						        paramName += " *";
+						    }
 							if (attribs[i].isArray()){
 								writer.write( "\n\t"
-		                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-		                                  + " * get"
+		                                  + paramName
+		                                  + " get"
 		                                  + methodName
 		                                  + "();\n");
 
@@ -450,8 +460,8 @@
 		                                  + "void set"
 		                                  + methodName
 		                                  + "("
-		                                  + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
-		                                  + " * pInValue");
+		                                  + paramName
+		                                  + " pInValue");
 							}
 							else{
 								if (isElementNillable(i)){

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedChoiceClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedChoiceClient.cpp?rev=370475&r1=370474&r2=370475&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedChoiceClient.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedChoiceClient.cpp
Thu Jan 19 06:23:27 2006
@@ -25,7 +25,7 @@
             array[x] = new xsd__int(x+1);			
 		}
 		arrayIn->set(array,5);
-		Value0->setIntValue(&arrayIn);
+		Value0->setIntValue(arrayIn);
 		url = argv[1];
 		ChoiceTestSoap ws(url);
 
@@ -33,7 +33,7 @@
 		int outputSize=0;
 		
 		for(int i=0;i<5;i++)
-			cout<<"Value1->IntValue->m_Array["<<i<<"] = "<<*((*(Value1->IntValue))->get(outputSize)[i])<<endl;
+			cout << "Value1->IntValue->m_Array[" << i << "] = " << *(Value1->IntValue->get(outputSize)[i])
<< endl;
 		  // Clear up input array        
         for (int deleteIndex = 0 ; deleteIndex < 5 ; deleteIndex++ )
         {

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedStringChoiceClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedStringChoiceClient.cpp?rev=370475&r1=370474&r2=370475&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedStringChoiceClient.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/UnboundedStringChoiceClient.cpp
Thu Jan 19 06:23:27 2006
@@ -25,7 +25,7 @@
 		array[3] = "d";
 		array[4] = "e";		
 		arrayIn->set(array,5);
-		Value0->setStringValue(&arrayIn);
+		Value0->setStringValue(arrayIn);
 	
 		if ( argc > 1 )
             url = argv[1];
@@ -36,7 +36,7 @@
 		int outputSize =0;
 		
 		for (int i=0;i<5;i++)
-			cout<<"Value1->StringValue->m_Array["<<i<<"] = "<<*((*(Value1->StringValue))->get(outputSize)[i])<<endl;
+			cout << "Value1->StringValue->m_Array[" << i << "] = " <<
*(Value1->StringValue->get(outputSize)[i]) << endl;
 
 		  // Clear up input array        
         for (int deleteIndex = 0 ; deleteIndex < 5 ; deleteIndex++ )



Mime
View raw message