You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mitch Gitman <cr...@excite.com> on 2002/11/11 01:45:22 UTC

resolved -- RE: running Java2WSDL via reflection

 Someone mentioned there was an Ant task for Java2WSDL. I'll check this out, but if it calls main(), it's still going to exit.One easy workaround. Subclass Java2WSDL and call directly the run() method called by main(). Both the constructor and run() are protected.--- On Sun 11/10, Mitch Gitman &lt; cressona@excite.com &gt; wrote:
From: Mitch Gitman [mailto: cressona@excite.com]To: axis-user@xml.apache.org, cressona@excite.com, axis-user@xml.apache.orgDate: Sun, 10 Nov 2002 18:01:35 -0500 (EST)Subject: RE: running Java2WSDL via reflection



Explanation and suggestion.Apparently, Java2WSDL is quitting for the most obvious reason. It's calling System.exit():/*** Main* Run the Java2WSDL emitter with the specified command-line arguments* @param args String[] command-line arguments*/public static void main(String args[]) {Java2WSDL java2wsdl = new Java2WSDL();System.exit(java2wsdl.run(args));}It seems that, as of now, the only way I can get the desired behavior is to modify Java2WSDL.java. It would be nice if there were a command-line flag for Java2WSDL -- and I would guess also WSDL2Java -- that amounts to "Don't exit when finished." Otherwise, anyone who wants to run Java2WSDL from a build script or Ant or the like is out of luck.If somebody knows an easier way...--- On Sun 11/10, Mitch Gitman &lt; cressona@excite.com &gt; wrote:
From: Mitch Gitman [mailto: cressona@excite.com]To: axis-user@xml.apache.orgDate: Sun, 10 Nov 2002 03:06:04 -0500 (EST)Subject: running Java2WSDL via reflection




Forgive me -- or just ignore me -- if this question isn�t totally on-topic. I manage to run Java2WSDL successfully to generate the WSDL for my web service. I manage to run it successfully whether it�s invoked directly or from within another Java application. But when it�s invoked by another application, it never passes control back to the other application. This is the case whether I run Java2WSDL passing it the arguments to generate my WSDL or I run it just with �-h� to spit out the help text.To invoke Java2WSDL via reflection, I call:main.invoke(null, argument);where main is the main() method and argument is an Object[] of the arguments. The class org.apache.axis.wsdl.Java2WSDL is loaded by a secondary class loader, which gets fed all the Axis JARs plus my classes.How do I get Java2WSDL to pass control back to the original application?