axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r332626 - in /webservices/axis/trunk/c: src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ tests/auto_build/testcases/client/cpp/ tests/auto_build/testcases/output/ tests/auto_build/testcases/wsdls/
Date Fri, 11 Nov 2005 18:23:09 GMT
Author: dicka
Date: Fri Nov 11 10:23:02 2005
New Revision: 332626

URL: http://svn.apache.org/viewcvs?rev=332626&view=rev
Log:
Further updates to resolve Jira issue AXISCPP-149. 

This update is the fourth stage, covering arrays of complex types within complex types.



Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=332626&r1=332625&r2=332626&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
Fri Nov 11 10:23:02 2005
@@ -393,9 +393,9 @@
                         elm = attribs[i].getTypeName();
                     }
 					arrayType = attribs[i].getTypeName();
-					writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"
+					writer.write("\tpSZ->serializeCmplxArray(param->"
 									+ attribs[i].getParamNameAsMember()
-									+ "),\n");
+									+ ",\n");
 					writer.write("\t\t(void*) Axis_Serialize_" + arrayType
 							+ ", (void*) Axis_Delete_" + arrayType
 							+ ", (void*) Axis_GetSize_" + arrayType + ",\n");

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=332626&r1=332625&r2=332626&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
Fri Nov 11 10:23:02 2005
@@ -559,9 +559,9 @@
                     }
                     else
                     {
-                        writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"
+                        writer.write("\tpSZ->serializeCmplxArray(param->"
                                         + attribs[i].getParamNameAsMember()
-                                        + "),\n");
+                                        + ",\n");
                         writer.write("\t\t\t\t\t\t (void*) Axis_Serialize_"
                                 + arrayType + ",\n");
                         writer.write("\t\t\t\t\t\t (void*) Axis_Delete_"
@@ -831,50 +831,10 @@
                                     + "\t\t\t\t\t\t\t\t  \""
                                     + attribs[i].getElementNameAsString()
                                     + "\", Axis_URI_" + arrayType + ");\n\n");
-                    writer.write("\t// Additional code to find if reference is pointer or
pointer to a pointer\n");
-
-                    if (nillable)
-                    {
-                        String attributeParamName = attribs[i].getParamName();
-                        String attributeTypeName = attribs[i].getTypeName();
-                        writer.write("\t" + attributeTypeName + " **	pp" + i
-                                + " = param->" + attributeParamName
-                                + ".m_Array;\n\n");
-                        writer.write("\tparam->" + attributeParamName
-                                + ".m_Size = array.m_Size;\n\n");
-                        writer.write("\tif( param->" + attributeParamName
-                                + ".m_Array == NULL)\n");
-                        writer.write("\t{\n");
-                        writer.write("\t\tpp" + i + " = new "
-                                + attributeTypeName + "*[array.m_Size];\n");
-                        writer.write("\t\tparam->" + attributeParamName
-                                + ".m_Array = pp" + i + ";\n");
-                        writer.write("\t}\n\n");
-                        writer.write("\t" + attributeTypeName + " *p" + i
-                                + " = (" + attributeTypeName
-                                + " *) array.m_Array;\n");
-                        writer.write("\t" + attributeTypeName + " default" + i + ";\n");
-                        writer.write("\tfor( int iCount" + i + " = 0; iCount"
-                                + i + " < array.m_Size; iCount" + i + "++)\n");
-                        writer.write("\t{\n");
-                        writer.write("\t\tpp" + i + "[iCount" + i + "] = new "
-                                + attributeTypeName + "();\n");
-                        writer.write("\t\t*(pp" + i + "[iCount" + i + "]) = p"
-                                + i + "[iCount" + i + "];\n");
-                        writer.write("\t\t// Set the array to default values so that the
delete does not delete subfields\n");
-                        writer.write("\t\tp" + i + "[iCount" + i + "] = default" + i + ";\n");
-                        writer.write("\t}\n");
-                        writer.write("\tdelete [] p" + i + ";\n");
-                    }
-                    else
-                    {
-                        writer.write("\tparam->"
-                                        + attribs[i].getParamNameAsMember()
-                                        + " = (" + attribs[i].getTypeName()
-                                        + "_Array&)array;\n");
-                    }
-
-                    writer.write("\t// End\n");
+                    writer.write("\tparam->" + attribs[i].getElementNameAsString() + "
= new " + arrayType + "_Array();\n");
+                    writer.write("\tparam->" + attribs[i].getElementNameAsString() + "->clone(*("
+ arrayType + "_Array *) array);\n");
+                	writer.write("\t((" + arrayType + "_Array*) array)->clear();\n");
+                	writer.write("\tAxis::AxisDelete((void *) array, XSD_ARRAY);\n");
                 }
             }
             else if (attribs[i].isSimpleType())

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp?rev=332626&r1=332625&r2=332626&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp Fri Nov
11 10:23:02 2005
@@ -172,6 +172,35 @@
 			}
 			delete complexOutputAxis_Array;
 
+			ComplexTypeWithComplexArray complexTypeWithComplexArray;
+			complexTypeWithComplexArray.setcomplexTypeWithSimpleElement(&complexArray);
+
+			ComplexTypeWithComplexArray * outputComplexTypeWithComplexArray = ws.complexTypeWithComplexArray(&complexTypeWithComplexArray);
+
+			complexOutputAxis_Array = outputComplexTypeWithComplexArray->getcomplexTypeWithSimpleElement();
+			outputSize = 0;
+			complexOutputArray = complexOutputAxis_Array->get(outputSize);
+			cout << "Complex array size is " << outputSize << endl;
+			if (complexOutputArray != NULL)
+			{
+				for (count = 0 ; count < outputSize ; count++)
+				{
+					if (complexOutputArray[count] != NULL)
+					{
+						cout << ((ComplexTypeWithSimpleElement) *complexOutputArray[count]).getsimpleType()
<< endl;
+					}
+					else
+					{
+						cout << "NULL" << endl;
+					}
+				}
+			}
+			else
+			{
+				cout << "NULL array" << endl;
+			}
+			delete outputComplexTypeWithComplexArray;
+
 			// Clean up complex input array
 			for (count = 0 ; count < inputSize ; count++)
 			{

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out?rev=332626&r1=332625&r2=332626&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out Fri Nov 11 10:23:02
2005
@@ -38,4 +38,8 @@
 0
 1
 2
+Complex array size is 3
+0
+1
+2
 ---------------------- TEST COMPLETE -----------------------------

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected?rev=332626&r1=332625&r2=332626&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
Fri Nov 11 10:23:02 2005
@@ -31,3 +31,14 @@
 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><complexTypeArrayResponse
xmlns="http://org.apache.axis/Arrays/"><complexTypeWithSimpleElement><simpleType>0</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>1</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>2</simpleType></complexTypeWithSimpleElement></complexTypeArrayResponse></soapenv:Body></soapenv:Envelope>
 0
 
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><complexTypeWithComplexArrayResponse
xmlns="http://org.apache.axis/Arrays/"><complexTypeWithComplexArray><complexTypeWithSimpleElement><simpleType>0</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>1</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>2</simpleType></complexTypeWithSimpleElement></complexTypeWithComplexArray></complexTypeWithComplexArrayResponse></soapenv:Body></soapenv:Envelope>
+0
+

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl?rev=332626&r1=332625&r2=332626&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl Fri Nov 11 10:23:02
2005
@@ -36,6 +36,12 @@
 				</xsd:sequence>
 			</xsd:complexType>
 
+			<xsd:complexType name="ComplexTypeWithComplexArray">
+				<xsd:sequence>
+					<xsd:element name="complexTypeWithSimpleElement" type="tns:ComplexTypeWithSimpleElement"
maxOccurs="unbounded"/>
+				</xsd:sequence>
+			</xsd:complexType>
+
             <xsd:element name="complexTypeWithSimpleArrayResponse">
 				<xsd:complexType>
 					<xsd:sequence>
@@ -72,6 +78,20 @@
             		</xsd:sequence>
             	</xsd:complexType>
             </xsd:element>
+            <xsd:element name="complexTypeWithComplexArrayResponse">
+            	<xsd:complexType>
+            		<xsd:sequence>
+						<xsd:element name="complexTypeWithComplexArray" type="tns:ComplexTypeWithComplexArray"/>
+					</xsd:sequence>
+            	</xsd:complexType>
+            </xsd:element>
+            <xsd:element name="complexTypeWithComplexArrayRequest">
+            	<xsd:complexType>
+            		<xsd:sequence>
+						<xsd:element name="complexTypeWithComplexArray" type="tns:ComplexTypeWithComplexArray"/>
+					</xsd:sequence>
+            	</xsd:complexType>
+            </xsd:element>
 		</xsd:schema>
 	</wsdl:types>
 	<wsdl:message name="simpleArrayResponse">
@@ -102,6 +122,16 @@
 			element="tns:complexTypeArrayRequest">
 		</wsdl:part>
 	</wsdl:message>
+	<wsdl:message name="complexTypeWithComplexArrayResponse">
+		<wsdl:part name="complexTypeWithComplexArrayResponse"
+			element="tns:complexTypeWithComplexArrayResponse">
+		</wsdl:part>
+	</wsdl:message>
+	<wsdl:message name="complexTypeWithComplexArrayRequest">
+		<wsdl:part name="complexTypeWithComplexArrayRequest"
+			element="tns:complexTypeWithComplexArrayRequest">
+		</wsdl:part>
+	</wsdl:message>
 	<wsdl:portType name="Arrays">
 		<wsdl:operation name="simpleArray">
 			<wsdl:input message="tns:simpleArrayRequest" />
@@ -119,6 +149,14 @@
 			<wsdl:input message="tns:complexTypeArrayRequest"></wsdl:input>
 			<wsdl:output message="tns:complexTypeArrayResponse"></wsdl:output>
 		</wsdl:operation>
+		<wsdl:operation name="complexTypeWithComplexArray">
+			<wsdl:input
+				message="tns:complexTypeWithComplexArrayRequest">
+			</wsdl:input>
+			<wsdl:output
+				message="tns:complexTypeWithComplexArrayResponse">
+			</wsdl:output>
+		</wsdl:operation>
 	</wsdl:portType>
 	<wsdl:binding name="ArraysSOAP" type="tns:Arrays">
 		<soap:binding style="document"
@@ -138,6 +176,10 @@
 			<wsdl:output></wsdl:output>
 		</wsdl:operation>
 		<wsdl:operation name="complexTypeArray">
+			<wsdl:input></wsdl:input>
+			<wsdl:output></wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="complexTypeWithComplexArray">
 			<wsdl:input></wsdl:input>
 			<wsdl:output></wsdl:output>
 		</wsdl:operation>



Mime
View raw message