I am working on eclipse plugin which will have a wizard. This wizard will be available form example from context menu while mouse right click on Java editor.
The wizard will be responsible for collecting such information as:
- location of WSDL file
- Package name
When the wizard finishes, I would like to have stub of a webservice described in WSDL generated into package provided earlier.
THE QUESTION IS: How can I generate webservice stub dymanically and from source code (not from command line) and add it to the current project?
Until now, I came across WSDL2Java (Axis), Apache CXF and wsimport. I try to use Apache CXF and wsimport but I'm always getting ClassNotFoundException even though all jars are included into buildpath. I think I might have used them incorrectly.
Please help me folks! Time for that task is running out :-(
Little example:
Let's say the code is (Apache CXF):
String[] args = {"-client", "-d", "D:\\test", "D:\test.wsdl" }; WSDLToJava w = new WSDLToJava(args); ToolContext t = new ToolContext(); w.run(t);
The first few lines of exception are:
java.lang.NoClassDefFoundError: org/apache/cxf/tools/wsdlto/WSDLToJava at plugin.wsreplication.ui.wizard.component.AddComponentWizard.performFinish(AddComponentWizard.java:160) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:752) at plugin.wsreplication.ui.wizard.component.AddComponentWizardDialog.finishPressed(AddComponentWizardDialog.java:39) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at plugin.wsreplication.ui.action.AddComponentAction.run(AddComponentAction.java:35) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)