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 < [EMAIL PROTECTED] > wrote:
From: Mitch Gitman [mailto: [EMAIL PROTECTED]] To: [EMAIL PROTECTED] Date: 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?
|
Join Excite! - http://www.excite.com The most personalized portal on the Web!
|
Join Excite! - http://www.excite.com
The most personalized portal on the Web!