gdaniels 02/03/13 11:50:59
Modified: java TODO.txt
java/samples/echo EchoService.java
EchoServiceBindingStub.java
java/src/org/apache/axis/client Call.java
java/src/org/apache/axis/providers/java RPCProvider.java
java/src/org/apache/axis/wsdl Skeleton.java
SkeletonImpl.java WSDL2Java.java
java/src/org/apache/axis/wsdl/toJava JavaSkelWriter.java
JavaStubWriter.java Parameters.java
SymbolTable.java Utils.java
java/test/outparams TestOutParams.java
java/test/wsdl/inout DetailedInoutTestCase.java
Log:
All parameter names (esp as returned by getParamName() in the skeletons)
are now QNames, which allows us to correctly emit XML when using
<part element=""> syntax in WSDL.
Revision Changes Path
1.21 +5 -4 xml-axis/java/TODO.txt
Index: TODO.txt
===================================================================
RCS file: /home/cvs/xml-axis/java/TODO.txt,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- TODO.txt 13 Mar 2002 15:20:01 -0000 1.20
+++ TODO.txt 13 Mar 2002 19:50:58 -0000 1.21
@@ -12,12 +12,13 @@
-----------------
! <Doug> Doug's issue 1: Attachments are broken
! <Russell> Published interfaces must be vetted.
+X <Glen> getParameterName() should return a QName
+X <Glyn> Taras' fix to MessageElement (getValue-like method).
! <?> getParameterName() should return a QName
-
MESSAGE PARSING / ENCODING
--------------------------
-* <Glen/Rich> Support different encodingStyles
+X <Glen/Rich> Support different encodingStyles
! <> Support literalxml encodingStyle
X <Rich> Multi-dimensional array support
@@ -114,8 +115,8 @@
GENERAL / UNCATEGORIZED
-----------------------
! <> Reorganize resources.properties into packages
-! <> Remove search-for-first-MessageContext-arg code
-! <> Remove ServiceClient
+X <Glen> Remove search-for-first-MessageContext-arg code
+X <Glen> Remove ServiceClient
! <> Before each release, make sure there aren't any English-language
strings in the code. Folks aren't very good about putting these
strings into resources.properties!
1.20 +3 -2 xml-axis/java/samples/echo/EchoService.java
Index: EchoService.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/echo/EchoService.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- EchoService.java 27 Feb 2002 19:07:51 -0000 1.19
+++ EchoService.java 13 Mar 2002 19:50:58 -0000 1.20
@@ -61,6 +61,7 @@
import org.apache.axis.encoding.Hex;
import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.namespace.QName;
/**
* Test implementation of the echo interop service. Original description of
@@ -79,11 +80,11 @@
init() ;
}
- public String getParameterName(String opName, int i) {
+ public QName getParameterName(String opName, int i) {
return skel.getParameterName(opName, i);
}
- public static String getParameterNameStatic(String opName, int i) {
+ public static QName getParameterNameStatic(String opName, int i) {
init();
return skel.getParameterName(opName, i);
}
1.3 +8 -3 xml-axis/java/samples/echo/EchoServiceBindingStub.java
Index: EchoServiceBindingStub.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/echo/EchoServiceBindingStub.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EchoServiceBindingStub.java 18 Feb 2002 15:05:35 -0000 1.2
+++ EchoServiceBindingStub.java 13 Mar 2002 19:50:58 -0000 1.3
@@ -9,6 +9,8 @@
package samples.echo;
+import javax.xml.rpc.namespace.QName;
+
public class EchoServiceBindingStub extends org.apache.axis.client.Stub implements
samples.echo.EchoServicePortType {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
@@ -567,9 +569,12 @@
else {
java.util.Map output;
output = call.getOutputParams();
- outputString.value = (java.lang.String) output.get("outputString");
- outputInteger.value = ((Integer)
output.get("outputInteger")).intValue();
- outputFloat.value = ((Float) output.get("outputFloat")).floatValue();
+ outputString.value = (java.lang.String)output.get(
+ new QName(null, "outputString"));
+ outputInteger.value = ((Integer)output.get(
+ new QName(null, "outputInteger"))).intValue();
+ outputFloat.value = ((Float) output.get(
+ new QName(null, "outputFloat"))).floatValue();
}
}
1.93 +1 -1 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.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- Call.java 13 Mar 2002 15:20:02 -0000 1.92
+++ Call.java 13 Mar 2002 19:50:58 -0000 1.93
@@ -1606,7 +1606,7 @@
for (int i = outParamStart; i < resArgs.size(); i++) {
RPCParam param = (RPCParam) resArgs.get(i);
- outParams.put(param.getName(), param.getValue());
+ outParams.put(param.getQName(), param.getValue());
}
}
} else {
1.48 +5 -5
xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java
Index: RPCProvider.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- RPCProvider.java 12 Mar 2002 19:02:31 -0000 1.47
+++ RPCProvider.java 13 Mar 2002 19:50:58 -0000 1.48
@@ -397,7 +397,7 @@
* of the method specified.
* (Use i=-1 to access the return name.)
*/
- protected String getParameterName(Object obj,
+ protected QName getParameterName(Object obj,
Method method,
int i,
String mName) {
@@ -411,21 +411,21 @@
*
* (Use i=-1 to access the return name.)
*/
- protected String getParameterName(Object obj,
+ protected QName getParameterName(Object obj,
Method method,
int i,
String mName,
Vector rpcParams) {
- String parmName = null;
+ QName parmName = null;
// Emitter skeletons keep track of the parameter names
if (obj instanceof org.apache.axis.wsdl.Skeleton)
parmName =
((org.apache.axis.wsdl.Skeleton)obj).getParameterName(method.getName(), i);
if (parmName == null) {
if (i >= 0) {
if (rpcParams != null && rpcParams.size() > i) {
- parmName = ((RPCParam)rpcParams.get(i)).getName();
+ parmName = ((RPCParam)rpcParams.get(i)).getQName();
} else {
- parmName = mName + "Result" + i;
+ parmName = new QName("", mName + "Result" + i);
}
}
}
1.4 +2 -1 xml-axis/java/src/org/apache/axis/wsdl/Skeleton.java
Index: Skeleton.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Skeleton.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Skeleton.java 19 Feb 2002 15:06:51 -0000 1.3
+++ Skeleton.java 13 Mar 2002 19:50:58 -0000 1.4
@@ -55,6 +55,7 @@
package org.apache.axis.wsdl;
import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.namespace.QName;
/**
* Interface for WSDL2Java generated skeletons
@@ -65,7 +66,7 @@
* operation. Use n=-1 to get the return value.
* Returns null if problems occur or the parameter is not known.
*/
- public String getParameterName(String operationName, int n);
+ public QName getParameterName(String operationName, int n);
/**
* Note: The implementor should also provide a static version of the
1.4 +20 -4 xml-axis/java/src/org/apache/axis/wsdl/SkeletonImpl.java
Index: SkeletonImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/SkeletonImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SkeletonImpl.java 27 Feb 2002 18:42:58 -0000 1.3
+++ SkeletonImpl.java 13 Mar 2002 19:50:58 -0000 1.4
@@ -56,6 +56,7 @@
import java.util.HashMap;
import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.namespace.QName;
/**
* Provides Base function implementation for the Skeleton interface
@@ -73,13 +74,13 @@
}
class MetaInfo {
- String[] names;
+ QName[] names;
ParameterMode[] modes;
String inputNamespace;
String outputNamespace;
String soapAction;
- MetaInfo(String[] names, ParameterMode[] modes, String inputNamespace,
+ MetaInfo(QName[] names, ParameterMode[] modes, String inputNamespace,
String outputNamespace, String soapAction) {
this.names = names;
this.modes = modes;
@@ -94,18 +95,33 @@
* The first name in the array is either the return name (which
* should be set to null if there is no return name)
**/
- public void add(String operation, String[] names, ParameterMode[] modes,
+ public void add(String operation, QName[] names, ParameterMode[] modes,
String inputNamespace, String outputNamespace, String soapAction) {
table.put(operation, new MetaInfo(names, modes, inputNamespace,
outputNamespace, soapAction));
}
/**
+ * Convenience method which allows passing an array of Strings which
+ * will be converted into QNames with no namespace.
+ **/
+ public void add(String operation, String[] names, ParameterMode[] modes,
+ String inputNamespace, String outputNamespace, String soapAction) {
+ QName [] qnames = new QName [names.length];
+ for (int i = 0; i < names.length; i++) {
+ QName qname = new QName(null, names[i]);
+ qnames[i] = qname;
+ }
+ add(operation, qnames, modes, inputNamespace,
+ outputNamespace, soapAction);
+ }
+
+ /**
* Used to return the name of the n-th parameter of the specified
* operation. Use -1 to get the return type name
* Returns null if problems occur or the parameter is not known.
*/
- public String getParameterName(String operationName, int n) {
+ public QName getParameterName(String operationName, int n) {
MetaInfo value = (MetaInfo) table.get(operationName);
if (value == null ||
value.names == null ||
1.13 +17 -8 xml-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java
Index: WSDL2Java.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- WSDL2Java.java 13 Mar 2002 05:18:06 -0000 1.12
+++ WSDL2Java.java 13 Mar 2002 19:50:58 -0000 1.13
@@ -114,7 +114,8 @@
// The emitter framework Emitter class.
private Emitter emitter;
// Timeout, in milliseconds, to let the Emitter do its work
- private long timeoutms = 45000; // 45 sec default
+ private long timeoutms = -1; // 45 sec default
+ //private long timeoutms = 45000; // 45 sec default
JavaWriterFactory writerFactory = null;
@@ -428,14 +429,22 @@
wsdlThread.start();
- while (!runnable.isDone()) {
- // Check at one-second intervals
- Thread.sleep(1000);
- if (new Date().getTime() > timeout) {
- wsdlThread.interrupt();
- throw new Exception(JavaUtils.getMessage("timedOut"));
- }
+ try {
+ if (timeoutms > 0)
+ wsdlThread.join(timeoutms);
+ else
+ wsdlThread.join();
+ } catch (InterruptedException e) {
}
+
+// while (!runnable.isDone()) {
+// // Check at one-second intervals
+// Thread.sleep(1000);
+// if (new Date().getTime() > timeout) {
+// wsdlThread.interrupt();
+// throw new Exception(JavaUtils.getMessage("timedOut"));
+// }
+// }
if (runnable.getFailure() != null) {
throw runnable.getFailure();
1.17 +8 -5
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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- JavaSkelWriter.java 28 Feb 2002 19:35:07 -0000 1.16
+++ JavaSkelWriter.java 13 Mar 2002 19:50:58 -0000 1.17
@@ -138,11 +138,11 @@
pw.println(" }");
// Initialize operation parameter names & modes
- pw.println(" public String getParameterName(String opName, int i) {");
+ pw.println(" public javax.xml.rpc.namespace.QName
getParameterName(String opName, int i) {");
pw.println(" return skel.getParameterName(opName, i);");
pw.println(" }");
pw.println();
- pw.println(" public static String getParameterNameStatic(String opName,
int i) {");
+ pw.println(" public static javax.xml.rpc.namespace.QName
getParameterNameStatic(String opName, int i) {");
pw.println(" init();");
pw.println(" return skel.getParameterName(opName, i);");
pw.println(" }");
@@ -186,15 +186,18 @@
// The invoked java name of the operation is stored.
String opName =
Utils.xmlNameToJava(operation.getOperation().getName());
pw.println(" skel.add(\"" + opName + "\",");
- pw.println(" new String[] {");
+ pw.println(" new javax.xml.rpc.namespace.QName[]
{");
if (parameters.returnType != null) {
- pw.println(" \"" + parameters.returnName +
"\",");
+ pw.println(" " +
+ Utils.getNewQName(parameters.returnName) + ",");
} else {
pw.println(" null,");
}
for (int j=0; j < parameters.list.size(); j++) {
Parameter p = (Parameter) parameters.list.get(j);
- pw.println(" \"" + p.getName() + "\",");
+ pw.println(" " +
+ Utils.getNewQName(Utils.getAxisQName(p.getQName())) +
+ ",");
}
pw.println(" },");
pw.println(" new javax.xml.rpc.ParameterMode[] {");
1.43 +13 -8
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.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- JavaStubWriter.java 13 Mar 2002 15:19:26 -0000 1.42
+++ JavaStubWriter.java 13 Mar 2002 19:50:58 -0000 1.43
@@ -621,6 +621,9 @@
p = (Parameter) parms.list.get(++i);
}
String javifiedName = Utils.xmlNameToJava(p.getName());
+ String qnameName = Utils.getNewQName(
+ Utils.getAxisQName(p.getQName()));
+
pw.println(" java.util.Map output;");
pw.println(" output = call.getOutputParams();");
// If expecting an array, need to call convert(..) because
@@ -632,14 +635,14 @@
pw.println(" // REVISIT THIS!");
pw.println(" " + javifiedName
+ ".value = (" + p.type.getName()
- + ")
org.apache.axis.utils.JavaUtils.convert(output.get(\""
- + p.getName() + "\"), " + p.type.getName()
+ + ")
org.apache.axis.utils.JavaUtils.convert(output.get("
+ + qnameName + "), " + p.type.getName()
+ ".class);");
}
else {
pw.println(" " + javifiedName + ".value = "
+ getResponseString(p.type,
- "output.get(\"" + p.getName() + "\")"));
+ "output.get(" + qnameName + ")"));
}
}
else {
@@ -672,6 +675,8 @@
for (int i = 0; i < parms.list.size (); ++i) {
Parameter p = (Parameter) parms.list.get (i);
String javifiedName = Utils.xmlNameToJava(p.getName());
+ String qnameName = Utils.getNewQName(
+ Utils.getAxisQName(p.getQName()));
if (p.mode != Parameter.IN) {
if (firstInoutIsResp) {
firstInoutIsResp = false;
@@ -682,13 +687,13 @@
pw.println(" // REVISIT THIS!");
pw.println (" " + javifiedName
+ ".value = (" + p.type.getName()
- + ")
org.apache.axis.utils.JavaUtils.convert(output.get(\"" + p.getName() + "\"), "
+ + ")
org.apache.axis.utils.JavaUtils.convert(output.get(" + qnameName + "), "
+ p.type.getName() + ".class);");
}
else {
pw.println (" " + javifiedName +
".value = " +
- getResponseString(p.type,
"output.get(\"" + p.getName() + "\")"));
+ getResponseString(p.type,
"output.get(" + qnameName + ")"));
}
}
else {
@@ -700,13 +705,13 @@
pw.println (" " + javifiedName
+ ".value = (" + p.type.getName()
+ ")
org.apache.axis.utils.JavaUtils.convert("
- + "output.get(\"" + p.getName() + "\"),
"
+ + "output.get(" + qnameName + "), "
+ p.type.getName() + ".class);");
}
else {
pw.println (" " + javifiedName
+ ".value = " +
getResponseString(p.type,
- "output.get(\"" + p.getName() + "\")"));
+ "output.get(" + qnameName + ")"));
}
}
}
@@ -724,7 +729,7 @@
pw.println(" return ("
+ parms.returnType.getName() + ")"
+
"org.apache.axis.utils.JavaUtils.convert(output.get("
- + parms.returnName + "),"
+ + Utils.getNewQName(parms.returnName) + "),"
+ parms.returnType.getName()+".class);");
} else if (parms.returnType != null) {
pw.println(" return " +
getResponseString(parms.returnType, "resp"));
1.4 +3 -2 xml-axis/java/src/org/apache/axis/wsdl/toJava/Parameters.java
Index: Parameters.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Parameters.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Parameters.java 14 Jan 2002 21:21:11 -0000 1.3
+++ Parameters.java 13 Mar 2002 19:50:59 -0000 1.4
@@ -54,6 +54,7 @@
*/
package org.apache.axis.wsdl.toJava;
+import javax.xml.rpc.namespace.QName;
import java.util.Vector;
/**
@@ -69,7 +70,7 @@
// The name of the return type (from the part name of the output message.
// Used to create the RPCParam for the return value.
- public String returnName = null;
+ public QName returnName = null;
// A comma-separated list of all of the faults
public String faultString = null;
@@ -84,7 +85,7 @@
public String toString() {
return "\nreturnType = " + returnType
- + "\nreturnTypeName = " + returnName
+ + "\nreturnName = " + returnName
+ "\nfaultString = " + faultString
+ "\nsignature = " + signature
+ "\n(inputs, inouts, outputs) = (" + inputs + ", " + inouts + ", "
+ outputs + ")"
1.44 +8 -1 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.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- SymbolTable.java 13 Mar 2002 15:19:27 -0000 1.43
+++ SymbolTable.java 13 Mar 2002 19:50:59 -0000 1.44
@@ -953,7 +953,14 @@
// then they are out parameters.
if (outputs.size() == 2) {
parameters.returnType = (TypeEntry) outputs.get(0);
- parameters.returnName = (String) outputs.get(1);
+ if (parameters.returnType instanceof DefinedElement) {
+ parameters.returnName = Utils.getAxisQName(
+ ((DefinedElement)parameters.returnType).getQName());
+ } else {
+ parameters.returnName =
+ new javax.xml.rpc.namespace.QName(null,
+ (String)outputs.get(1));
+ }
++parameters.outputs;
}
else {
1.19 +16 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
Index: Utils.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Utils.java 13 Mar 2002 15:19:27 -0000 1.18
+++ Utils.java 13 Mar 2002 19:50:59 -0000 1.19
@@ -688,6 +688,22 @@
}
} // getJavaPackageName
+ /**
+ * Common code for generating a QName in emitted code. Note that there's
+ * no semicolon at the end, so we can use this in a variety of contexts.
+ */
+ public static String getNewQName(javax.xml.rpc.namespace.QName qname)
+ {
+ return "new javax.xml.rpc.namespace.QName(\"" +
+ qname.getNamespaceURI() + "\", \"" +
+ qname.getLocalPart() + "\")";
+ }
+
+ public static javax.xml.rpc.namespace.QName getAxisQName(QName qname)
+ {
+ return new javax.xml.rpc.namespace.QName(qname.getNamespaceURI(),
+ qname.getLocalPart());
+ }
}
1.10 +5 -4 xml-axis/java/test/outparams/TestOutParams.java
Index: TestOutParams.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/outparams/TestOutParams.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TestOutParams.java 28 Jan 2002 18:23:03 -0000 1.9
+++ TestOutParams.java 13 Mar 2002 19:50:59 -0000 1.10
@@ -15,6 +15,7 @@
import org.apache.axis.server.AxisServer;
import org.apache.axis.transport.local.LocalTransport;
+import javax.xml.rpc.namespace.QName;
import java.util.Map;
/**
@@ -81,11 +82,11 @@
Map outParams = client.getOutputParams();
assertNotNull("No output Params returned!", outParams);
- Object param = outParams.get("out1");
- assertEquals("Param 0 does not equal expected value", param,
ServiceHandler.OUTPARAM1);
+ Object param = outParams.get(new QName(null, "out1"));
+ assertEquals("Param out1 does not equal expected value",
ServiceHandler.OUTPARAM1, param);
- param = outParams.get("out2");
- assertEquals("Param 1 does not equal expected value", param,
ServiceHandler.OUTPARAM2);
+ param = outParams.get(new QName(null, "out2"));
+ assertEquals("Param out2 does not equal expected value",
ServiceHandler.OUTPARAM2, param);
assertEquals("Return value does not equal expected value",
((Integer)ret).intValue(), ServiceHandler.RESPONSE.intValue());
}
1.6 +0 -14 xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java
Index: DetailedInoutTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/inout/DetailedInoutTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DetailedInoutTestCase.java 23 Feb 2002 00:48:28 -0000 1.5
+++ DetailedInoutTestCase.java 13 Mar 2002 19:50:59 -0000 1.6
@@ -607,18 +607,4 @@
}
}
- public static void main (String[] args) throws Exception {
- try
- {
- Options opts = new Options(args);
-// Log log =
LogFactory.getLog(org.apache.axis.transport.http.HTTPSender.class.getName());
-// log.setPriority (Priority.DEBUG);
-
- TestRunner.main(new String[] {DetailedInoutTestCase.class.getName()});
- }
- catch (Throwable t)
- {
- t.printStackTrace (System.err);
- }
- }
}