You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/01/10 20:12:08 UTC
cvs commit: xml-axis/java/test/wsdl/parameterOrder VerifyTestCase.java parameterOrder.wsdl
butek 02/01/10 11:12:08
Modified: java/src/org/apache/axis/client Call.java
java/src/org/apache/axis/wsdl/toJava JavaSkelWriter.java
JavaStubWriter.java JavaWriterFactory.java
SymbolTable.java
java/test/inout DetailedInoutTestCase.java
InoutSOAPBindingImpl.java
java/test/wsdl Wsdl2javaTestSuite.xml
Added: java/test/wsdl/parameterOrder VerifyTestCase.java
parameterOrder.wsdl
Log:
Make parameterOrder work ala JAX-RPC.
- generate params in proper order
- tweak the Call object slightly to support new order.
- fix inout test to follow this new order
- add parameterOrder test
Revision Changes Path
1.57 +33 -13 xml-axis/java/src/org/apache/axis/client/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Call.java 4 Jan 2002 22:30:03 -0000 1.56
+++ Call.java 10 Jan 2002 19:12:07 -0000 1.57
@@ -916,7 +916,7 @@
//////////////////////////////////////////////////
Vector result = new Vector();
int j = 0 ;
- for ( i = 0 ; i < numParams ; i++ ) {
+ for ( i = 0 ; i < paramNames.size() ; i++ ) {
if (paramModes.get(i) == ParameterMode.PARAM_MODE_OUT)
continue ;
RPCParam p = new RPCParam( (String) paramNames.get(i),
@@ -1171,7 +1171,7 @@
Object result = null ;
// Clear the output params
- outParams = null;
+ outParams = new HashMap();
// If we have headers to insert, do so now.
if (myHeaders != null) {
@@ -1207,18 +1207,38 @@
}
if (resArgs != null && resArgs.size() > 0) {
- RPCParam param = (RPCParam)resArgs.get(0);
- result = param.getValue();
- /**
- * Are there out-params? If so, return a Vector instead.
- */
- if (resArgs.size() > 1) {
- outParams = new HashMap();
- for (int i = 1; i < resArgs.size(); i++) {
- param = (RPCParam) resArgs.get(i);
- outParams.put(param.getName(), param.getValue());
- }
+ // If there is no return, then we start at index 0 to create the outParams Map.
+ // If there IS a return, then we start with 1.
+ int outParamStart = 0;
+
+ // If we have resArgs and the returnType is specified, then the first
+ // resArgs is the return. If we have resArgs and neither returnType
+ // nor paramTypes are specified, then we assume that the caller is
+ // following the non-JAX-RPC AXIS shortcut of not having to specify
+ // the return, in which case we again assume the first resArgs is
+ // the return.
+ // NOTE 1: the non-JAX-RPC AXIS shortcut allows a potential error
+ // to escape notice. If the caller IS NOT following the non-JAX-RPC
+ // shortcut but instead intentionally leaves returnType and params
+ // null (ie., a method that takes no parameters and returns nothing)
+ // then, if we DO receive something it should be an error, but this
+ // code passes it through. The ideal solution here is to require
+ // this caller to set the returnType to void, but there's no void
+ // type in XML.
+ // NOTE 2: we should probably verify that the resArgs element
+ // types match the expected returnType and paramTypes, but I'm not
+ // sure how to do that since the resArgs value is a Java Object
+ // and the returnType and paramTypes are QNames.
+ if (returnType != null || paramTypes == null) {
+ RPCParam param = (RPCParam)resArgs.get(0);
+ result = param.getValue();
+ outParamStart = 1;
+ }
+
+ for (int i = outParamStart; i < resArgs.size(); i++) {
+ RPCParam param = (RPCParam) resArgs.get(i);
+ outParams.put(param.getName(), param.getValue());
}
}
1.4 +28 -31 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java
Index: JavaSkelWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JavaSkelWriter.java 13 Dec 2001 19:07:39 -0000 1.3
+++ JavaSkelWriter.java 10 Jan 2002 19:12:08 -0000 1.4
@@ -174,19 +174,24 @@
Parameter p = (Parameter) parms.list.get(i);
String holder = Utils.holder(p.type, symbolTable);
+ String holderVar = Utils.xmlNameToJava(p.name);
if (p.mode == Parameter.INOUT) {
- pw.println(" " + holder + " " + p.name + "Holder = new " + holder + "(" + Utils.xmlNameToJava(p.name) + ");");
+ pw.println(" " + holder + " " + holderVar
+ + "Holder = new " + holder + "(" + holderVar + ");");
}
else if (p.mode == Parameter.OUT) {
- pw.println(" " + holder + " " + p.name + "Holder = new " + holder + "();");
+ pw.println(" " + holder + " " + holderVar
+ + "Holder = new " + holder + "();");
}
}
// Call the real implementation
- if ( parms.returnType == null )
+ if (parms.returnType == null) {
pw.print(" ");
- else
+ }
+ else {
pw.print(" Object ret = ");
+ }
String call = "impl." + Utils.xmlNameToJava(operation.getName()) + "(";
boolean needComma = false;
for (int i = 0; i < parms.list.size(); ++i) {
@@ -196,44 +201,36 @@
needComma = true;
Parameter p = (Parameter) parms.list.get(i);
- if (p.mode == Parameter.IN)
- call = call + Utils.xmlNameToJava(p.name);
- else
- call = call + p.name + "Holder";
+ call = call + Utils.xmlNameToJava(p.name);
+ if (p.mode != Parameter.IN)
+ call = call + "Holder";
}
call = call + ")";
- if (parms.outputs == 0)
+ if (parms.returnType == null) {
pw.println(call + ";");
- else
+ }
+ else {
pw.println(wrapPrimitiveType(parms.returnType, call) + ";");
+ }
// Handle the outputs, if there are any.
if (parms.inouts + parms.outputs > 0) {
- if (parms.inouts == 0 && parms.outputs == 1)
- // The only output is a single return value; simply pass it through.
- pw.println(" return ret;");
- else if (parms.outputs == 0 && parms.inouts == 1) {
- // There is only one inout parameter. Find it in the parms list and write
- // its return
- int i = 0;
+ pw.println(" org.apache.axis.server.ParamList list = new org.apache.axis.server.ParamList();");
+ if (parms.returnType != null)
+ pw.println(" list.add(new org.apache.axis.message.RPCParam(\""
+ + parms.returnName + "\", ret));");
+ for (int i = 0; i < parms.list.size(); ++i) {
Parameter p = (Parameter) parms.list.get(i);
- while (p.mode != Parameter.INOUT)
- p = (Parameter) parms.list.get(++i);
- pw.println(" return " + wrapPrimitiveType(p.type, p.name + "Holder.value") + ";");
- }
- else {
- // There are more than 1 output parts, so create a Vector to put them into.
- pw.println(" org.apache.axis.server.ParamList list = new org.apache.axis.server.ParamList();");
- if (parms.returnType != null)
- pw.println(" list.add(new org.apache.axis.message.RPCParam(\"" + parms.returnName + "\", ret));");
- for (int i = 0; i < parms.list.size(); ++i) {
- Parameter p = (Parameter) parms.list.get(i);
- if (p.mode != Parameter.IN)
- pw.println(" list.add(new org.apache.axis.message.RPCParam(\"" + p.name + "\", " + wrapPrimitiveType(p.type, p.name + "Holder.value") +"));");
+ if (p.mode != Parameter.IN) {
+ String pName = Utils.xmlNameToJava(p.name);
+ pw.println(" list.add(new org.apache.axis.message.RPCParam(\""
+ + p.name + "\", "
+ + wrapPrimitiveType(p.type, pName + "Holder.value")
+ + "));");
}
- pw.println(" return list;");
}
+ pw.println(" return list;");
}
pw.println(" }");
1.11 +33 -23 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
Index: JavaStubWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- JavaStubWriter.java 9 Jan 2002 14:08:38 -0000 1.10
+++ JavaStubWriter.java 10 Jan 2002 19:12:08 -0000 1.11
@@ -425,8 +425,9 @@
qn.getNamespaceURI() + "\", \"" +
qn.getLocalPart() + "\")";
pw.println(" call.setReturnType(" + outputType + ");");
-
- pw.println();
+ }
+ else {
+ pw.println(" call.setReturnType(null);");
}
pw.println(" }");
pw.println(" catch (javax.xml.rpc.JAXRPCException jre) {");
@@ -454,17 +455,21 @@
for (int i = 0; i < parms.list.size(); ++i) {
Parameter p = (Parameter) parms.list.get(i);
- if (needComma) {
- if (p.mode != Parameter.OUT)
+ String javifiedName = Utils.xmlNameToJava(p.name);
+ if (p.mode != Parameter.OUT) {
+ if (needComma) {
pw.print(", ");
+ }
+ else {
+ needComma = true;
+ }
+ if (p.mode == Parameter.IN) {
+ pw.print(wrapPrimitiveType(p.type, javifiedName));
+ }
+ else { // p.mode == Parameter.INOUT
+ pw.print(wrapPrimitiveType(p.type, javifiedName + ".value"));
+ }
}
- else
- needComma = true;
- String javifiedName = Utils.xmlNameToJava(p.name);
- if (p.mode == Parameter.IN)
- pw.print(wrapPrimitiveType(p.type, javifiedName));
- else if (p.mode == Parameter.INOUT)
- pw.print(wrapPrimitiveType(p.type, javifiedName + ".value"));
}
pw.println("});");
pw.println();
@@ -486,21 +491,24 @@
p = (Parameter) parms.list.get(++i);
}
String javifiedName = Utils.xmlNameToJava(p.name);
+ pw.println(" java.util.Map output = call.getOutputParams();");
// If expecting an array, need to call convert(..) because
// the runtime stores arrays in a different form (ArrayList).
// NOTE A:
// It seems that it should be the responsibility of the
// Call to convert the ArrayList into the proper array.
if (p.type.getName().endsWith("[]")) {
- pw.println(" // REVISIT THIS!");
- pw.println (" " + javifiedName
+ pw.println(" // REVISIT THIS!");
+ pw.println(" " + javifiedName
+ ".value = (" + p.type.getName()
- + ") org.apache.axis.utils.JavaUtils.convert(resp, "
- + p.type.getName() + ".class);");
+ + ") org.apache.axis.utils.JavaUtils.convert(output.get(\""
+ + p.name + "\"), " + p.type.getName()
+ + ".class);");
}
else {
- pw.println (" " + javifiedName + ".value = "
- + getResponseString(p.type, "resp"));
+ pw.println(" " + javifiedName + ".value = "
+ + getResponseString(p.type,
+ "output.get(\"" + p.name + "\")"));
}
}
else {
@@ -542,13 +550,13 @@
pw.println(" // REVISIT THIS!");
pw.println (" " + javifiedName
+ ".value = (" + p.type.getName()
- + ") org.apache.axis.utils.JavaUtils.convert(resp, "
+ + ") org.apache.axis.utils.JavaUtils.convert(output.get(\"" + p.name + "\"), "
+ p.type.getName() + ".class);");
}
else {
pw.println (" " + javifiedName +
".value = " +
- getResponseString(p.type, "resp"));
+ getResponseString(p.type, "output.get(\"" + p.name + "\")"));
}
}
else {
@@ -581,10 +589,12 @@
parms.returnType.getName() != null &&
parms.returnType.getName().indexOf("[]") > 0) {
pw.println(" // REVISIT THIS!");
- pw.println(" return ("+parms.returnType.getName() + ")"
- +"org.apache.axis.utils.JavaUtils.convert(resp,"
- + parms.returnType.getName()+".class);");
- } else {
+ pw.println(" return ("
+ + parms.returnType.getName() + ")"
+ + "org.apache.axis.utils.JavaUtils.convert(output.get("
+ + parms.returnName + "),"
+ + parms.returnType.getName()+".class);");
+ } else if (parms.returnType != null) {
pw.println(" return " + getResponseString(parms.returnType, "resp"));
}
1.5 +15 -3 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaWriterFactory.java
Index: JavaWriterFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaWriterFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JavaWriterFactory.java 14 Dec 2001 20:01:16 -0000 1.4
+++ JavaWriterFactory.java 10 Jan 2002 19:12:08 -0000 1.5
@@ -395,26 +395,38 @@
skelSig = " public Object " + name + "(";
boolean needComma = false;
+ boolean needSkelSigComma = false;
for (int i = 0; i < parms.list.size(); ++i) {
Parameter p = (Parameter) parms.list.get(i);
if (needComma) {
signature = signature + ", ";
- if (p.mode != Parameter.OUT)
- skelSig = skelSig + ", ";
}
- else
+ else {
needComma = true;
+ }
String javifiedName = Utils.xmlNameToJava(p.name);
if (p.mode == Parameter.IN) {
signature = signature + p.type.getName() + " " + javifiedName;
+ if (needSkelSigComma) {
+ skelSig = skelSig + ", ";
+ }
+ else {
+ needSkelSigComma = true;
+ }
skelSig = skelSig + p.type.getName() + " " + javifiedName;
}
else if (p.mode == Parameter.INOUT) {
signature = signature + Utils.holder(p.type, symbolTable) + " "
+ javifiedName;
+ if (needSkelSigComma) {
+ skelSig = skelSig + ", ";
+ }
+ else {
+ needSkelSigComma = true;
+ }
skelSig = skelSig + p.type.getName() + " " + javifiedName;
}
else// (p.mode == Parameter.OUT)
1.11 +10 -6 xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java
Index: SymbolTable.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SymbolTable.java 31 Dec 2001 18:31:41 -0000 1.10
+++ SymbolTable.java 10 Jan 2002 19:12:08 -0000 1.11
@@ -839,20 +839,24 @@
}
// Get the mode info about those parts that aren't in the parameterOrder list.
- // Since they're not in the parameterOrder list, the order doesn't matter.
- // Add the input and inout parts first, then add the output parts.
+ // Since they're not in the parameterOrder list, the order is, first all in (and
+ // inout) parameters, then all out parameters, in the order they appear in the
+ // messages.
for (int i = 1; i < inputs.size(); i += 2) {
int outdex = getPartIndex((String) inputs.get(i), outputs);
addInishParm(inputs, outputs, i, outdex, parameters, false);
}
- // Now that the remaining in and inout parameters are collected, the first entry in the
- // outputs Vector is the return value. The rest are out parameters.
- if (outputs.size() > 0) {
+ // Now that the remaining in and inout parameters are collected, determine the status of
+ // outputs. If there is only 1, then it is the return value. If there are more than 1,
+ // then they are out parameters.
+ if (outputs.size() == 2) {
parameters.returnType = (TypeEntry) outputs.get(0);
parameters.returnName = (String) outputs.get(1);
++parameters.outputs;
- for (int i = 3; i < outputs.size(); i += 2) {
+ }
+ else {
+ for (int i = 1; i < outputs.size(); i += 2) {
addOutParm(outputs, i, parameters, false);
}
}
1.9 +73 -59 xml-axis/java/test/inout/DetailedInoutTestCase.java
Index: DetailedInoutTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/inout/DetailedInoutTestCase.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DetailedInoutTestCase.java 13 Dec 2001 19:07:40 -0000 1.8
+++ DetailedInoutTestCase.java 10 Jan 2002 19:12:08 -0000 1.9
@@ -5,6 +5,7 @@
import junit.swingui.TestRunner;
import org.apache.axis.utils.Options;
+import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.StringHolder;
/**
@@ -35,7 +36,7 @@
{
String out;
if (ph == null)
- out = "[PHONE NUMBER NOT FOUND!}";
+ out = "[PHONE NUMBER NOT FOUND!]";
else
out ="Phone: (" + ph.getAreaCode () + ") " + ph.getExchange () + "-" + ph.getNumber ();
return out;
@@ -370,120 +371,126 @@
public void testOutManyInout0In0 ()
{
+ StringHolder sh = new StringHolder("outManyInout0In0");
AddressHolder ah = new AddressHolder (expectedAddress);
- String ret = null;
try
{
- ret = io.outManyInout0In0 (ah);
+ io.outManyInout0In0 (sh, ah);
+ assertEquals (sh.value, " arghhh!");
assertTrue(equals (ah.value, returnAddress));
- assertEquals(" arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0In0\nexpected address = "
- + printAddress (returnAddress) + "\nactual address = "
- + printAddress (ah.value) + "\nexpected string = arghhh!\nactual string = "
- + ret + t.getMessage());
+ + printAddress (returnAddress) + "\nactual address = "
+ + printAddress (ah.value)
+ + "\nexpected string = arghhh!\nactual string = "
+ + sh.value + " " + t.getMessage());
}
}
public void testOutManyInout0In1 ()
{
+ IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInout0In1 ("outManyInout0In1", sh);
+ io.outManyInout0In1 ("outManyInout0In1", ih, sh);
+ assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0In1\nexpected string = yo ho ho!\nactual string = "
- + sh.value + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + sh.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ih.value + " " + t.getMessage());
}
}
public void testOutManyInout0InMany ()
{
+ IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInout0InMany ("outManyInout0InMany", expectedAddress, sh);
+ io.outManyInout0InMany ("outManyInout0InMany", expectedAddress, ih, sh);
+ assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0InMany\nexpected string = yo ho ho!\nactual string = "
- + sh.value + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + sh.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ih.value + " " + t.getMessage());
}
}
public void testOutManyInout1In0 ()
{
StringHolder shinout = new StringHolder ("outManyInout1In0");
+ IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInout1In0 (shinout, shout);
+ io.outManyInout1In0 (shinout, ihout, shout);
assertEquals("outManyInout1In0 yo ho ho!", shinout.value);
+ assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1In0\nexpected string1 = outManyInout1In0 yo ho ho!\nactual string1 = "
- + shinout.value + "\nexpected string2 = yo ho ho!\nactual string2 = "
- + shout.value + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + shinout.value
+ + "\nexpected string2 = yo ho ho!\nactual string2 = "
+ + shout.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ihout.value + " "
+ + t.getMessage());
}
}
public void testOutManyInout1In1 ()
{
StringHolder shinout = new StringHolder ("outManyInout1In1");
+ IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInout1In1 (shinout, expectedAddress, shout);
+ io.outManyInout1In1 (shinout, expectedAddress, ihout, shout);
assertEquals("outManyInout1In1 yo ho ho!", shinout.value);
+ assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1In1\nexpected string1 = outManyInout1In1 yo ho ho!\nactual string = "
- + shinout.value + "\nexpected string2 = yo ho ho!\nactual string2 = "
- + shout.value + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + shinout.value
+ + "\nexpected string2 = yo ho ho!\nactual string2 = "
+ + shout.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ihout.value + " "
+ + t.getMessage());
}
}
public void testOutManyInout1InMany ()
{
PhoneHolder ph = new PhoneHolder (expectedPhone);
+ IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInout1InMany ("outManyInout1InMany", expectedAddress, ph, sh);
+ io.outManyInout1InMany ("outManyInout1InMany", expectedAddress, ph, ih, sh);
assertTrue(equals (ph.value, returnPhone));
+ assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1InMany\nexpected phone = "
- + printPhone (returnPhone) + "\nactual phone = "
- + printPhone (ph.value) + "\nexpected string = yo ho ho!\nactual string = "
- + sh.value + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + printPhone (returnPhone) + "\nactual phone = "
+ + printPhone (ph.value)
+ + "\nexpected string = yo ho ho!\nactual string = "
+ + sh.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ih.value + " " + t.getMessage());
}
}
@@ -491,23 +498,26 @@
{
StringHolder shinout = new StringHolder ("outManyInoutManyIn0");
AddressHolder ah = new AddressHolder (expectedAddress);
+ IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInoutManyIn0 (shinout, ah, shout);
+ io.outManyInoutManyIn0 (shinout, ah, ihout, shout);
assertEquals("outManyInoutManyIn0 yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
+ assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyIn0\nexpected string1 = outManyInoutManyIn0 yo ho ho!\nactual string1 = "
- + shinout.value + "\nexpected address = " + printAddress (returnAddress)
- + "\nactual address = " + printAddress (ah.value) + "\nexpected string2 = yo ho ho!\nactual string2 = "
- + shout.value + "\nexpected number = " + returnNumber + "\nactual number = "
- + ret + t.getMessage());
+ + shinout.value + "\nexpected address = "
+ + printAddress (returnAddress) + "\nactual address = "
+ + printAddress (ah.value)
+ + "\nexpected string2 = yo ho ho!\nactual string2 = "
+ + shout.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ihout.value + " "
+ + t.getMessage());
}
}
@@ -515,24 +525,26 @@
{
StringHolder shinout = new StringHolder ("outManyInoutManyIn1");
AddressHolder ah = new AddressHolder (expectedAddress);
+ IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInoutManyIn1 (shinout, ah, expectedPhone, shout);
+ io.outManyInoutManyIn1 (shinout, ah, expectedPhone, ihout, shout);
assertEquals("outManyInoutManyIn1 yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
+ assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyIn1\nexpected string1 = outManyInoutManyIn1 yo ho ho!\nactual string1 = "
- + shinout.value + "\nexpected address = " + printAddress (returnAddress)
- + "\nactual address = " + printAddress (ah.value)
- + "\nexpected string2 = yo ho ho!\nactual string2 = " + shout.value
- + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + shinout.value + "\nexpected address = "
+ + printAddress (returnAddress) + "\nactual address = "
+ + printAddress (ah.value)
+ + "\nexpected string2 = yo ho ho!\nactual string2 = "
+ + shout.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ihout.value + " "
+ + t.getMessage());
}
}
@@ -540,24 +552,26 @@
{
StringHolder shinout = new StringHolder ("outManyInoutManyInMany");
AddressHolder ah = new AddressHolder (expectedAddress);
+ IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
- int ret = 0;
try
{
- ret = io.outManyInoutManyInMany (shinout, ah, expectedPhone, expectedNumber, shout);
+ io.outManyInoutManyInMany (shinout, ah, expectedPhone, expectedNumber, ihout, shout);
assertEquals("outManyInoutManyInMany yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
+ assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
- assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyInMany\nexpected string1 = outManyInoutManyInMany yo ho ho!\nactual string1 = "
- + shinout.value + "\nexpected address = " + printAddress (returnAddress)
- + "\nactual address = " + printAddress (ah.value)
- + "\nexpected string2 = yo ho ho!\nactual string2 = " + shout.value
- + "\nexpected number = " + returnNumber
- + "\nactual number = " + ret + t.getMessage());
+ + shinout.value + "\nexpected address = "
+ + printAddress (returnAddress) + "\nactual address = "
+ + printAddress (ah.value)
+ + "\nexpected string2 = yo ho ho!\nactual string2 = "
+ + shout.value + "\nexpected number = " + returnNumber
+ + "\nactual number = " + ihout.value + " "
+ + t.getMessage());
}
}
1.9 +20 -20 xml-axis/java/test/inout/InoutSOAPBindingImpl.java
Index: InoutSOAPBindingImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/inout/InoutSOAPBindingImpl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- InoutSOAPBindingImpl.java 13 Dec 2001 19:07:40 -0000 1.8
+++ InoutSOAPBindingImpl.java 10 Jan 2002 19:12:08 -0000 1.9
@@ -1,5 +1,6 @@
package test.inout;
+import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.StringHolder;
public class InoutSOAPBindingImpl implements Inout
@@ -353,24 +354,23 @@
}
- public String outManyInout0In0 (AddressHolder address) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout0In0 (StringHolder name, AddressHolder address) throws org.apache.axis.AxisFault, TestFailed
{
- if (address.value == null)
- {
+ if (name.value == null && address.value == null) {
+ name.value = " arghhh!";
address.value = returnAddress;
- return " arghhh!";
}
else
throw new TestFailed ();
}
- public int outManyInout0In1 (String name, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout0In1 (String name, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout0In1".equals (name) && otherName.value == null)
{
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -382,12 +382,12 @@
}
- public int outManyInout0InMany (String name, Address address, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout0InMany (String name, Address address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout0InMany".equals (name) && equals (address, expectedAddress) && otherName.value == null)
{
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -401,13 +401,13 @@
}
- public int outManyInout1In0 (StringHolder name, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout1In0 (StringHolder name, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout1In0".equals (name.value) && otherName.value == null)
{
+ number.value = returnNumber;
name.value = name.value + " yo ho ho!";
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -419,13 +419,13 @@
}
- public int outManyInout1In1 (StringHolder name, Address address, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout1In1 (StringHolder name, Address address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (address, expectedAddress) && "outManyInout1In1".equals (name.value) && otherName.value == null)
{
+ number.value = returnNumber;
name.value = name.value + " yo ho ho!";
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -441,13 +441,13 @@
}
- public int outManyInout1InMany (String name, Address address, PhoneHolder phone, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInout1InMany (String name, Address address, PhoneHolder phone, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout1InMany".equals (name) && equals (address, expectedAddress) && equals (phone.value, expectedPhone) && otherName.value == null)
{
phone.value = returnPhone;
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -463,14 +463,14 @@
}
- public int outManyInoutManyIn0 (StringHolder name, AddressHolder address, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInoutManyIn0 (StringHolder name, AddressHolder address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInoutManyIn0".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -484,14 +484,14 @@
}
- public int outManyInoutManyIn1 (StringHolder name, AddressHolder address, Phone phone, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInoutManyIn1 (StringHolder name, AddressHolder address, Phone phone, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && "outManyInoutManyIn1".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
@@ -507,14 +507,14 @@
}
- public int outManyInoutManyInMany (StringHolder name, AddressHolder address, Phone phone, int otherNumber, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
+ public void outManyInoutManyInMany (StringHolder name, AddressHolder address, Phone phone, int otherNumber, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && expectedNumber == otherNumber && "outManyInoutManyInMany".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
+ number.value = returnNumber;
otherName.value = " yo ho ho!";
- return returnNumber;
}
else
{
1.53 +7 -0 xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml
Index: Wsdl2javaTestSuite.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- Wsdl2javaTestSuite.xml 7 Jan 2002 15:54:20 -0000 1.52
+++ Wsdl2javaTestSuite.xml 10 Jan 2002 19:12:08 -0000 1.53
@@ -356,6 +356,13 @@
testcase="yes">
</wsdl2java>
+ <!-- This tests parameterOrder. -->
+ <wsdl2java url="test/wsdl/parameterOrder/parameterOrder.wsdl"
+ output="build/work"
+ skeleton="yes"
+ testcase="yes">
+ </wsdl2java>
+
<!-- The following WSDL are BAD. We're keeping them here so we can -->
<!-- check periodically to see whether the owner has fixed them. -->
1.1 xml-axis/java/test/wsdl/parameterOrder/VerifyTestCase.java
Index: VerifyTestCase.java
===================================================================
package test.wsdl.parameterOrder;
import test.wsdl.parameterOrder.ParameterOrderService;
import test.wsdl.parameterOrder.ParameterOrderTest;
/**
* This class is taken from the generated TestCase. The generated test case is still generated
* to verify that the generated test case is always compilable. THIS test case exists
* because I know this is correct. If the generation of the bindings changes, it's likely that
* the generation of the TestCase will change as well, so we wouldn't know whether they changed
* for the worse if they all changed the same. This test case should fail to compile if generated
* stuff changed for the worse.
*/
public class VerifyTestCase extends junit.framework.TestCase {
public VerifyTestCase(String name) {
super(name);
}
public void testParameterOrder() {
test.wsdl.parameterOrder.ParameterOrderTest binding = new ParameterOrderService().getParameterOrder();
assertTrue("binding is null", binding != null);
try {
binding.oneIn(0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.oneInout(new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.oneOut(new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInNoOrder(0, 0, 0, 0, 0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInoutNoOrder(new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveOutNoOrder(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveIn(0, 0, 0, 0, 0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInout(new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveOut(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
int value = -3;
value = binding.someInoutPartialOrder1(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.someInoutPartialOrder2(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fourOutPartialOrder(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
int value = -3;
value = binding.oneReturn(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
}
}
1.1 xml-axis/java/test/wsdl/parameterOrder/parameterOrder.wsdl
Index: parameterOrder.wsdl
===================================================================
<?xml version="1.0" ?>
<definitions
name="parameterOrder test"
targetNamespace="parameterOrder.wsdl.test"
xmlns:tns="parameterOrder.wsdl.test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- message declns -->
<message name="empty"/>
<message name="1part">
<part name="one" type="xsd:int"/>
</message>
<message name="2parts">
<part name="one" type="xsd:int"/>
<part name="two" type="xsd:int"/>
</message>
<message name="3parts">
<part name="one" type="xsd:int"/>
<part name="two" type="xsd:int"/>
<part name="three" type="xsd:int"/>
</message>
<message name="4parts">
<part name="one" type="xsd:int"/>
<part name="two" type="xsd:int"/>
<part name="three" type="xsd:int"/>
<part name="four" type="xsd:int"/>
</message>
<message name="5parts">
<part name="one" type="xsd:int"/>
<part name="two" type="xsd:int"/>
<part name="three" type="xsd:int"/>
<part name="four" type="xsd:int"/>
<part name="five" type="xsd:int"/>
</message>
<!-- port type declns -->
<portType name="parameterOrderTest">
<operation name="oneIn" parameterOrder="one">
<input message="tns:1part"/>
<output message="tns:empty"/>
</operation>
<operation name="oneInout" parameterOrder="one">
<input message="tns:1part"/>
<output message="tns:1part"/>
</operation>
<operation name="oneOut" parameterOrder="one">
<input message="tns:empty"/>
<output message="tns:1part"/>
</operation>
<operation name="fiveInNoOrder">
<input message="tns:5parts"/>
<output message="tns:empty"/>
</operation>
<operation name="fiveInoutNoOrder">
<input message="tns:5parts"/>
<output message="tns:5parts"/>
</operation>
<operation name="fiveOutNoOrder">
<input message="tns:empty"/>
<output message="tns:5parts"/>
</operation>
<operation name="fiveIn" parameterOrder="five four three two one">
<input message="tns:5parts"/>
<output message="tns:empty"/>
</operation>
<operation name="fiveInout" parameterOrder="five four three two one">
<input message="tns:5parts"/>
<output message="tns:5parts"/>
</operation>
<operation name="fiveOut" parameterOrder="five four three two one">
<input message="tns:empty"/>
<output message="tns:5parts"/>
</operation>
<operation name="someInoutPartialOrder1" parameterOrder="four two one">
<input message="tns:2parts"/>
<output message="tns:4parts"/>
</operation>
<operation name="someInoutPartialOrder2" parameterOrder="four two one">
<input message="tns:2parts"/>
<output message="tns:5parts"/>
</operation>
<operation name="fourOutPartialOrder" parameterOrder="three one">
<input message="tns:empty"/>
<output message="tns:4parts"/>
</operation>
<operation name="oneReturn" parameterOrder="three one">
<input message="tns:empty"/>
<output message="tns:3parts"/>
</operation>
</portType>
<!-- binding declns -->
<binding name="parameterOrderBinding" type="tns:parameterOrderTest">
<soap:binding
style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="oneIn">
<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="oneInout">
<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="oneOut">
<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="fiveInNoOrder">
<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="fiveInoutNoOrder">
<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="fiveOutNoOrder">
<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="fiveIn">
<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="fiveInout">
<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="fiveOut">
<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="someInoutPartialOrder1">
<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="someInoutPartialOrder2">
<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="fourOutPartialOrder">
<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="oneReturn">
<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>
</binding>
<!-- service decln -->
<service name="parameterOrderService">
<port name="parameterOrder" binding="tns:parameterOrderBinding">
<soap:address location="http://localhost:8080/axis/services/parameterOrder"/>
</port>
</service>
</definitions>