butek 02/04/08 16:18:45
Modified: java/src/org/apache/axis/wsdl/toJava JavaImplWriter.java
java/test/wsdl/types ComprehensiveTypes.wsdl
VerifyTestCase.java
Log:
Bugzilla 7577 said: "[wsdl2java] - Impl class do not compile when having
array inout parameters."
Bugzilla 7577 showed a hole in our test suite that I filled - the types test
had in/inout/out tests of various types, but the out tests were really return
tests, not out parameter tests, so I added the real out tests (and kept the
old out tests as XXXReturn tests). Once I updated the test, I fixed a few
problems that had fallen through this hole.
Revision Changes Path
1.16 +17 -1
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java
Index: JavaImplWriter.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- JavaImplWriter.java 2 Apr 2002 22:05:19 -0000 1.15
+++ JavaImplWriter.java 8 Apr 2002 23:18:45 -0000 1.16
@@ -184,6 +184,8 @@
pw.print("new java.math.BigDecimal(-3)");
} else if (paramType.equals("java.math.BigInteger")) {
pw.print("new java.math.BigInteger(\"-3\")");
+ } else if (paramType.equals("java.lang.Object")) {
+ pw.print("new java.lang.String()");
} else if (paramType.equals("byte[]")) {
pw.print("new byte[0]");
} else if (paramType.equals("java.lang.Byte[]")) {
@@ -192,8 +194,22 @@
pw.print("java.util.Calendar.getInstance()");
} else if (paramType.equals("javax.xml.rpc.namespace.QName")) {
pw.print("new javax.xml.rpc.namespace.QName(\"\", \"\")");
+ } else if (paramType.endsWith("[]")) {
+ pw.print("new "
+ + JavaUtils.replace(paramType, "[]", "[0]"));
} else {
- pw.print("new " + paramType + "()");
+ // We have some constructed type.
+ Vector v = SchemaUtils.getEnumerationBaseAndValues(
+ param.getType().getNode(), symbolTable);
+
+ if (v != null) {
+ // This constructed type is an enumeration. Use the first
one.
+ String enumeration = (String) v.get(1);
+ pw.print(paramType + "." + enumeration);
+ } else {
+ // This constructed type is a normal type, instantiate it.
+ pw.print("new " + paramType + "()");
+ }
}
pw.println(";");
}
1.25 +202 -12 xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl
Index: ComprehensiveTypes.wsdl
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ComprehensiveTypes.wsdl 5 Apr 2002 16:16:53 -0000 1.24
+++ ComprehensiveTypes.wsdl 8 Apr 2002 23:18:45 -0000 1.25
@@ -612,7 +612,11 @@
<input message="tns:enum"/>
<output message="tns:enum"/>
</operation>
- <operation name="enumOut">
+ <operation name="enumOut" parameterOrder="enum">
+ <input message="tns:empty"/>
+ <output message="tns:enum"/>
+ </operation>
+ <operation name="enumReturn">
<input message="tns:empty"/>
<output message="tns:enum"/>
</operation>
@@ -624,7 +628,11 @@
<input message="tns:array"/>
<output message="tns:array"/>
</operation>
- <operation name="arrayOut">
+ <operation name="arrayOut" parameterOrder="array">
+ <input message="tns:empty"/>
+ <output message="tns:array"/>
+ </operation>
+ <operation name="arrayReturn">
<input message="tns:empty"/>
<output message="tns:array"/>
</operation>
@@ -637,7 +645,11 @@
<input message="tns:arrayM"/>
<output message="tns:arrayM"/>
</operation>
- <operation name="arrayMOut">
+ <operation name="arrayMOut" parameterOrder="arrayM">
+ <input message="tns:emptyM"/>
+ <output message="tns:arrayM"/>
+ </operation>
+ <operation name="arrayMReturn">
<input message="tns:emptyM"/>
<output message="tns:arrayM"/>
</operation>
@@ -650,7 +662,11 @@
<input message="tns:complexAll"/>
<output message="tns:complexAll"/>
</operation>
- <operation name="complexAllOut">
+ <operation name="complexAllOut" parameterOrder="complexAll">
+ <input message="tns:empty"/>
+ <output message="tns:complexAll"/>
+ </operation>
+ <operation name="complexAllReturn">
<input message="tns:empty"/>
<output message="tns:complexAll"/>
</operation>
@@ -662,7 +678,11 @@
<input message="tns:complexSequence"/>
<output message="tns:complexSequence"/>
</operation>
- <operation name="complexSequenceOut">
+ <operation name="complexSequenceOut" parameterOrder="complexSequence">
+ <input message="tns:empty"/>
+ <output message="tns:complexSequence"/>
+ </operation>
+ <operation name="complexSequenceReturn">
<input message="tns:empty"/>
<output message="tns:complexSequence"/>
</operation>
@@ -674,7 +694,11 @@
<input message="tns:elemWComplex"/>
<output message="tns:elemWComplex"/>
</operation>
- <operation name="elemWComplexOut">
+ <operation name="elemWComplexOut" parameterOrder="elemWComplex">
+ <input message="tns:empty"/>
+ <output message="tns:elemWComplex"/>
+ </operation>
+ <operation name="elemWComplexReturn">
<input message="tns:empty"/>
<output message="tns:elemWComplex"/>
</operation>
@@ -686,7 +710,11 @@
<input message="tns:complexWComplex"/>
<output message="tns:complexWComplex"/>
</operation>
- <operation name="complexWComplexOut">
+ <operation name="complexWComplexOut" parameterOrder="complexWComplex">
+ <input message="tns:empty"/>
+ <output message="tns:complexWComplex"/>
+ </operation>
+ <operation name="complexWComplexReturn">
<input message="tns:empty"/>
<output message="tns:complexWComplex"/>
</operation>
@@ -698,7 +726,11 @@
<input message="tns:any"/>
<output message="tns:any"/>
</operation>
- <operation name="anyOut">
+ <operation name="anyOut" parameterOrder="any">
+ <input message="tns:empty"/>
+ <output message="tns:any"/>
+ </operation>
+ <operation name="anyReturn">
<input message="tns:empty"/>
<output message="tns:any"/>
</operation>
@@ -710,7 +742,11 @@
<input message="tns:animal"/>
<output message="tns:animal"/>
</operation>
- <operation name="animalOut">
+ <operation name="animalOut" parameterOrder="animal">
+ <input message="tns:empty"/>
+ <output message="tns:animal"/>
+ </operation>
+ <operation name="animalReturn">
<input message="tns:empty"/>
<output message="tns:animal"/>
</operation>
@@ -722,11 +758,15 @@
<input message="tns:cat"/>
<output message="tns:cat"/>
</operation>
- <operation name="catOut">
+ <operation name="catOut" parameterOrder="cat">
+ <input message="tns:empty"/>
+ <output message="tns:cat"/>
+ </operation>
+ <operation name="catReturn">
<input message="tns:empty"/>
<output message="tns:cat"/>
</operation>
- <operation name="methodBoolean">
+ <operation name="methodBoolean">
<input message="tns:inputBoolean"/>
<output message="tns:outputBoolean"/>
</operation>
@@ -917,6 +957,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="enumReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="arrayIn">
<soap:operation soapAction=""/>
<input>
@@ -962,6 +1017,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="arrayReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="arrayMIn">
<soap:operation soapAction=""/>
@@ -1008,6 +1078,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="arrayMReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="complexAllIn">
<soap:operation soapAction=""/>
@@ -1054,6 +1139,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="complexAllReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="complexSequenceIn">
<soap:operation soapAction=""/>
<input>
@@ -1099,6 +1199,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="complexSequenceReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="elemWComplexIn">
<soap:operation soapAction=""/>
<input>
@@ -1144,6 +1259,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="elemWComplexReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="complexWComplexIn">
<soap:operation soapAction=""/>
<input>
@@ -1189,6 +1319,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="complexWComplexReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="anyIn">
<soap:operation soapAction=""/>
<input>
@@ -1234,6 +1379,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="anyReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="animalIn">
<soap:operation soapAction=""/>
<input>
@@ -1279,6 +1439,21 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
+ <operation name="animalReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
<operation name="catIn">
<soap:operation soapAction=""/>
<input>
@@ -1324,7 +1499,22 @@
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
- <operation name="methodBoolean">
+ <operation name="catReturn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="methodBoolean">
<soap:operation soapAction=""/>
<input>
<soap:body
1.19 +72 -11 xml-axis/java/test/wsdl/types/VerifyTestCase.java
Index: VerifyTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/VerifyTestCase.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- VerifyTestCase.java 3 Apr 2002 15:28:36 -0000 1.18
+++ VerifyTestCase.java 8 Apr 2002 23:18:45 -0000 1.19
@@ -27,6 +27,7 @@
import javax.xml.rpc.holders.IntegerWrapperHolder;
import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.LongHolder;
+import javax.xml.rpc.holders.ObjectHolder;
import javax.xml.rpc.holders.QNameHolder;
import javax.xml.rpc.holders.ShortWrapperHolder;
import javax.xml.rpc.holders.ShortHolder;
@@ -176,8 +177,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ EnumHolder value = new EnumHolder();
+ binding.enumOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
Enum value = null;
- value = binding.enumOut();
+ value = binding.enumReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -192,7 +199,13 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
}
try {
- String[] value = binding.arrayOut();
+ ArrayHolder value = new ArrayHolder();
+ binding.arrayOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
+ }
+ try {
+ String[] value = binding.arrayReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
}
@@ -207,7 +220,13 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
}
try {
- int[][][] value = binding.arrayMOut();
+ ArrayMHolder value = new ArrayMHolder();
+ binding.arrayMOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
+ }
+ try {
+ int[][][] value = binding.arrayMReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re);
}
@@ -226,8 +245,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ ComplexAllHolder value = new ComplexAllHolder();
+ binding.complexAllOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
ComplexAll value = null;
- value = binding.complexAllOut();
+ value = binding.complexAllReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -247,8 +272,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ ComplexSequenceHolder value = new ComplexSequenceHolder();
+ binding.complexSequenceOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
ComplexSequence value = null;
- value = binding.complexSequenceOut();
+ value = binding.complexSequenceReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -290,8 +321,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ ElemWComplexHolder value = new ElemWComplexHolder();
+ binding.elemWComplexOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
ElemWComplex value = null;
- value = binding.elemWComplexOut();
+ value = binding.elemWComplexReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -317,8 +354,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ ComplexWComplexHolder value = new ComplexWComplexHolder();
+ binding.complexWComplexOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
ComplexWComplex value = null;
- value = binding.complexWComplexOut();
+ value = binding.complexWComplexReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -328,12 +371,18 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
- binding.anyInout(new javax.xml.rpc.holders.ObjectHolder(new
java.lang.String("yo ho ho")));
+ binding.anyInout(new ObjectHolder(new java.lang.String("yo ho ho")));
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
+ ObjectHolder value = new ObjectHolder();
+ binding.anyOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
- java.lang.Object value = binding.anyOut();
+ java.lang.Object value = binding.anyReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -356,8 +405,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ AnimalHolder value = new AnimalHolder();
+ binding.animalOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
Animal value = null;
- value = binding.animalOut();
+ value = binding.animalReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
@@ -372,8 +427,14 @@
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}
try {
+ CatHolder value = new CatHolder();
+ binding.catOut(value);
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
+ }
+ try {
Cat value = null;
- value = binding.catOut();
+ value = binding.catReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception
caught: " + re );
}