tomj 2002/05/31 13:29:51
Modified: java/test/wsdl Java2WsdlAntTask.java
java/src/org/apache/axis/wsdl Java2WSDL.java
Log:
Add a --style (-y) option to the command line Java2WSDL.
Add support in the Ant task.
Revision Changes Path
1.12 +14 -1 xml-axis/java/test/wsdl/Java2WsdlAntTask.java
Index: Java2WsdlAntTask.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/Java2WsdlAntTask.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Java2WsdlAntTask.java 28 Apr 2002 18:10:57 -0000 1.11
+++ Java2WsdlAntTask.java 31 May 2002 20:29:51 -0000 1.12
@@ -83,6 +83,7 @@
private String exclude = null;
private String stopClasses = null;
private String tm = "1.1";
+ private String style = null;
// The method executing the task
public void execute() throws BuildException {
@@ -98,6 +99,7 @@
log("\texcluded:" + exclude, Project.MSG_VERBOSE);
log("\tstopClasses:" + stopClasses, Project.MSG_VERBOSE);
log("\ttypeMappingVersion:" + tm, Project.MSG_VERBOSE);
+ log("\tstyle:" + style, Project.MSG_VERBOSE);
// Instantiate the emitter
Emitter emitter = new Emitter();
@@ -121,7 +123,13 @@
} else {
emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
}
-
+ if (style != null) {
+ if (style.equalsIgnoreCase("DOCUMENT")) {
+ emitter.setMode(Emitter.MODE_DOCUMENT);
+ } else if (style.equalsIgnoreCase("RPC")) {
+ emitter.setMode(Emitter.MODE_RPC);
+ }
+ }
emitter.setIntfNamespace(namespace);
emitter.setLocationUrl(location);
emitter.setUseInheritedMethods(useInheritedMethods);
@@ -177,6 +185,11 @@
// The setter for the "stopClasses" attribute
public void setStopClasses(String stopClasses) {
this.stopClasses = stopClasses;
+ }
+
+ // The setter for the "style" attribute
+ public void setStyle(String style) {
+ this.style = style;
}
/** the command arguments */
1.18 +22 -2 xml-axis/java/src/org/apache/axis/wsdl/Java2WSDL.java
Index: Java2WSDL.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Java2WSDL.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Java2WSDL.java 16 May 2002 17:45:00 -0000 1.17
+++ Java2WSDL.java 31 May 2002 20:29:51 -0000 1.18
@@ -96,6 +96,7 @@
protected static final int STOP_CLASSES_OPT = 'c';
protected static final int TYPEMAPPING_OPT = 'T';
protected static final int SOAPACTION_OPT = 'A';
+ protected static final int STYLE_OPT = 'y';
/**
* Define the understood options. Each CLOptionDescriptor contains:
@@ -182,7 +183,12 @@
new CLOptionDescriptor("soapAction",
CLOptionDescriptor.ARGUMENT_REQUIRED,
SOAPACTION_OPT,
- JavaUtils.getMessage("j2woptsoapAction00"))
+ JavaUtils.getMessage("j2woptsoapAction00")),
+ new CLOptionDescriptor("style",
+ CLOptionDescriptor.ARGUMENT_REQUIRED,
+ STYLE_OPT,
+ JavaUtils.getMessage("j2woptStyle00"))
+
};
protected Emitter emitter;
@@ -230,6 +236,8 @@
* @param CLOption is the option
*/
protected void parseOption(CLOption option) {
+ String value;
+
switch (option.getId()) {
case CLOption.TEXT_ARGUMENT:
if (className != null) {
@@ -320,7 +328,7 @@
break;
case TYPEMAPPING_OPT:
- String value = option.getArgument();
+ value = option.getArgument();
if (value.equals("1.1")) {
emitter.setDefaultTypeMapping(
DefaultTypeMappingImpl.getSingleton());
@@ -345,6 +353,18 @@
}
break;
+ case STYLE_OPT:
+ value = option.getArgument();
+ if (value.equalsIgnoreCase("DOCUMENT")) {
+ emitter.setMode(Emitter.MODE_DOCUMENT);
+ } else if (value.equalsIgnoreCase("RPC")) {
+ emitter.setMode(Emitter.MODE_RPC);
+ } else {
+ System.out.println(JavaUtils.getMessage("j2wBadSoapAction00"));
+ }
+ break;
+
+
default:
break;
}