tomj 2002/05/31 13:34:32
Modified: java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
Log:
Add code to correctly set the operation QName when in 'wrapped' mode.
We need to use the name and namespace of the message element, not
the namespace of the body in the binding.
Revision Changes Path
1.65 +11 -2
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.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- JavaStubWriter.java 31 May 2002 19:08:10 -0000 1.64
+++ JavaStubWriter.java 31 May 2002 20:34:32 -0000 1.65
@@ -580,9 +580,18 @@
}
pw.println(" call.setOperationStyle(\"" + styleStr + "\");");
-
// Operation name
- pw.println(" call.setOperationName(new
javax.xml.rpc.namespace.QName(\"" + namespace + "\", \"" + operation.getName() +
"\"));" );
+ if (styleStr.equals("wrapped")) {
+ // We need to make sure the operation name, which is what we
+ // wrap the elements in, matches the Qname of the parameter
+ // element.
+ Map partsMap =
operation.getOperation().getInput().getMessage().getParts();
+ Part p = (Part)partsMap.values().iterator().next();
+ QName q = p.getElementName();
+ pw.println(" call.setOperationName(new
javax.xml.rpc.namespace.QName(\"" + q.getNamespaceURI() + "\", \"" + q.getLocalPart()
+ "\"));" );
+ } else {
+ pw.println(" call.setOperationName(new
javax.xml.rpc.namespace.QName(\"" + namespace + "\", \"" + operation.getName() +
"\"));" );
+ }
// Invoke the operation
pw.println();