Wonder where the Microsoft Visual Studio "Add Web Reference" is for your favorite free java IDE: Eclipse? Well I have to admit it's not as visual as M$, but I think it will serve the job: generating a Java Client Stub based on a published Web Service Description Language or better known as WSDL. Anyway have a look yourself at the screenshots. Maybe I can safe you the hassle of installing these complete unreliable free software components. What's up with those people? Let their work expose to all those critical programmers. Hey they just are a bunch of Software Exhibitionists, and can I have a patent on this, please.. Anyway if you are still reading you are probably not a software architects, and also not a hardcore coder.. I never read this far on a website. I'm more the Visual kind of guy. Looking for the images. Hmmm, come to think of it. I could get me started on some visual programming and bootstrap myself out of here.
author: M Ensing
the org.apache.axis.wsdl2java.eclipse and org.apache.axis are installed in the eclipse\plugins\ directory. <go to installation instructions>
Select a file container in eclipse (folder), right click to get pop-up menu and select Import
The first page of the import wizard will appear on screen. Select the Import WebService reference
The second page contains the general settings.
The File container is pre-filled with the selected folder. This will be the location where the generated source files will be stored. Although after generation you can move these files around. You have to make sure that the folder structure and the java namespaces stay in synch.
Url to WSDL is the link to the published Web Service. You can search for this with the internet browser. For example here is a good place to start www.xmethods.org. In my example I had a Web Service running on my localhost port :7078. But that is very specific here.
You can leave all the defaults.
You don't have to set anything in the advanced settings page.
When pressing the Finish button the plug-in starts retrieving the WSDL and generating the java classes.
If all goes well you should get the generated files, but as you can see you also have some errors flags.
The errors are caused by the missing classpath references to the axis.jar etc packages. We are going to setup a global reference to the plugin directory.
Go to Windows\Preferences\ java\ classpath varaiables and create a New... variable with the name
Browse to the folder
After setting this global variable we are going to add classpath values to the current work project.
Right click on your project and go to properties
Go to the Java Build Path and select the Libraries tab.
Add Variable and select the ORG_APACHE_AXIS what we just created. Press Extend.
For the extension we select all the jar files:
axis.jar, axis-eclipse.jar, commons-discovery.jar, commons-logging.jar, jaxrpc.jar saaj.jar, wsdl4j.jar
We can invoke the webservice by creating a new java class
Write some code what could go like
Eclipse already compiles the code when you save it. So you are ready to Run the code.
Happy Web Service invocations, and my special greetings to the Axis, Ant, log4j, and all those other great projects out there. Without them, I could not have made it. Stop snobbing, you're making me cry...
To install the plugin, simply copy and extract both org.apache.axis.wsdl2java.eclipse_220.127.116.11.zip and org.apache.axis_1.1.zip into the %ECLIPSE_HOME%/plugins directory and (re)start your Eclipse workbench.
Looking for the source or latest downloads? Got in this unbelievable
situation of a bug? Leave a message? Or remember the day how long we
go back, back to the top...