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 di...@apache.org on 2004/12/02 13:53:51 UTC
cvs commit: ws-axis/java/tools/org/apache/axis/tools/ant/wsdl Wsdl2javaAntTask.java
dims 2004/12/02 04:53:51
Modified: java/docs/ant axis-wsdl2java.html
java/src/org/apache/axis/wsdl/toJava Emitter.java
JavaServiceImplWriter.java
java/src/org/apache/axis/i18n resource.properties
java/src/org/apache/axis/wsdl WSDL2Java.java
java/tools/org/apache/axis/tools/ant/wsdl
Wsdl2javaAntTask.java
Log:
Fix for AXIS-1680 - Add an offline/unchecked-url mode to WSDL2Java
from Guillaume Sauthier (guillaume.sauthier@objectweb.org)
Revision Changes Path
1.10 +13 -0 ws-axis/java/docs/ant/axis-wsdl2java.html
Index: axis-wsdl2java.html
===================================================================
RCS file: /home/cvs/ws-axis/java/docs/ant/axis-wsdl2java.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- axis-wsdl2java.html 8 Jul 2004 14:30:29 -0000 1.9
+++ axis-wsdl2java.html 2 Dec 2004 12:53:51 -0000 1.10
@@ -342,6 +342,19 @@
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">allowInvalidURL</font>
+ </td>
+ <td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">flag used to allow Stub generation even if WSDL endpoint URL is not a valid URL. It's the responsibility of the user to update the endpoint value before using generated classes; default=false</font>
+ </td>
+ <td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
+ </td>
+ </tr>
+
+ <!-- Attribute -->
+ <tr>
+ <td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">implementationClassName</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
1.74 +16 -0 ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
Index: Emitter.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- Emitter.java 9 Nov 2004 19:20:26 -0000 1.73
+++ Emitter.java 2 Dec 2004 12:53:51 -0000 1.74
@@ -94,6 +94,9 @@
/** Use JAX-RPC 1.1 type mappings */
private boolean useJaxRPC11Mappings = false;
+ /** Check if URL endpoints are valid or not */
+ private boolean allowInvalidURL = false;
+
/** Field packageName */
private String packageName = null;
@@ -974,4 +977,17 @@
this.implementationClassName = implementationClassName;
}
+ /**
+ * @return Returns the allowInvalidURL.
+ */
+ public boolean isAllowInvalidURL() {
+ return allowInvalidURL;
+ }
+
+ /**
+ * @param allowInvalidURL The allowInvalidURL to set.
+ */
+ public void setAllowInvalidURL(boolean allowInvalidURL) {
+ this.allowInvalidURL = allowInvalidURL;
+ }
}
1.41 +12 -5 ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java
Index: JavaServiceImplWriter.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- JavaServiceImplWriter.java 15 Oct 2004 16:34:13 -0000 1.40
+++ JavaServiceImplWriter.java 2 Dec 2004 12:53:51 -0000 1.41
@@ -232,11 +232,18 @@
}
if (url == null) {
- throw new IOException(Messages.getMessage("emitFail03",
- new String[]{
- portName,
- className,
- address}));
+ if (emitter.isAllowInvalidURL()) {
+ // Unchecked URL mode
+ System.err.println(Messages.getMessage("emitWarnInvalidURL01", new String[] {portName, className, address}));
+ } else {
+ // Checked URL mode :
+ // URL invalid -> Exception
+ throw new IOException(Messages.getMessage("emitFail03",
+ new String[]{
+ portName,
+ className,
+ address}));
+ }
}
}
1.104 +3 -0 ws-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -r1.103 -r1.104
--- resource.properties 30 Nov 2004 01:57:53 -0000 1.103
+++ resource.properties 2 Dec 2004 12:53:51 -0000 1.104
@@ -199,6 +199,8 @@
emitFailtUndefinedPort01=Emitter failure. There is an undefined portType ({0}) in the WSDL document.\nHint: make sure <binding type=\"..\"> is fully qualified.
emitFailtUndefinedPort02=Emitter failure. There is an undefined portType ({0}) in the WSDL document {1}.\nHint: make sure <binding type=\"..\"> is fully qualified.
+emitWarnInvalidURL01=Emitter Warning. Invalid endpoint address in port {0} in service {1}: {2}
+
emitter00=emitter
empty00=empty
@@ -535,6 +537,7 @@
optionVerbose00=print informational messages
+optionAllowInvalidURL=emit file even if WSDL endpoint URL is not a valid URL
outMsg00=Out message: {0}
params00=Parameters are: {0}
1.51 +12 -3 ws-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java
Index: WSDL2Java.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- WSDL2Java.java 29 Oct 2004 20:25:25 -0000 1.50
+++ WSDL2Java.java 2 Dec 2004 12:53:51 -0000 1.51
@@ -90,9 +90,12 @@
/** Field IMPL_CLASS_OPT */
protected static final int IMPL_CLASS_OPT = 'c';
- /** Field IMPL_CLASS_OPT */
+ /** Field JARPC11_OPT */
protected static final int JAXRPC11_OPT = 'j';
+ /** Field ALLOW_INVALID_URL_OPT */
+ protected static final int ALLOW_INVALID_URL_OPT = 'u';
+
/** Field emitter */
private Emitter emitter;
@@ -178,8 +181,10 @@
IMPL_CLASS_OPT,
Messages.getMessage("implementationClassName")),
new CLOptionDescriptor("jaxrpc", CLOptionDescriptor.ARGUMENT_DISALLOWED,
- JAXRPC11_OPT, Messages.getMessage("optionJaxrpc"))
- };
+ JAXRPC11_OPT, Messages.getMessage("optionJaxrpc")),
+ new CLOptionDescriptor("allowInvalidURL", CLOptionDescriptor.ARGUMENT_DISALLOWED,
+ ALLOW_INVALID_URL_OPT, Messages.getMessage("optionAllowInvalidURL"))
+ };
/**
* Instantiate a WSDL2Java emitter.
@@ -317,6 +322,10 @@
case JAXRPC11_OPT:
emitter.setUseJaxRPC11Mappings(true);
+ break;
+
+ case ALLOW_INVALID_URL_OPT:
+ emitter.setAllowInvalidURL(true);
break;
default :
1.22 +10 -0 ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java
Index: Wsdl2javaAntTask.java
===================================================================
RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Wsdl2javaAntTask.java 29 Oct 2004 20:25:25 -0000 1.21
+++ Wsdl2javaAntTask.java 2 Dec 2004 12:53:51 -0000 1.22
@@ -87,6 +87,7 @@
private boolean helperGen = false;
private boolean noWrapped = false;
private boolean jaxrpc11mappings = false;
+ private boolean allowInvalidURL = false;
private String factory = null;
private HashMap namespaceMap = new HashMap();
private String output = ".";
@@ -180,6 +181,7 @@
log("\t:password" + password, logLevel);
log("\t:noWrapped" + noWrapped, logLevel);
log("\t:jaxrpc11mappings" + jaxrpc11mappings, logLevel);
+ log("\t:allowInvalidURL" + allowInvalidURL, logLevel);
log("\t:implementationClassName" + implementationClassName, logLevel);
log("\t:classpath" + classpath, logLevel);
traceNetworkSettings(logLevel);
@@ -234,6 +236,7 @@
emitter.setTypeMappingVersion(typeMappingVersion);
emitter.setNowrap(noWrapped);
emitter.setUseJaxRPC11Mappings(jaxrpc11mappings);
+ emitter.setAllowInvalidURL(allowInvalidURL);
if (namespaceMappingFile != null) {
emitter.setNStoPkg(namespaceMappingFile.toString());
}
@@ -523,6 +526,13 @@
*/
public void setJaxrpc11mappings(boolean b) {
this.jaxrpc11mappings = b;
+ }
+
+ /**
+ * Set the allowInvalidURL flag.
+ */
+ public void setAllowInvalidUrl(boolean b) {
+ this.allowInvalidURL = b;
}
/**