I’m learning how to develop SOAP web services with Java.
So far now I’ve been following this excellent tutorial
It all goes well, I have my web service working from the command line with it’s embedded server and then, with the help of NetBeans I deployed it on Tomcat.
I’d like to know the steps to manually deploy it on Tomcat, in order to learn how it’s done and because I don’t like depending on an IDE.
I mean, I’d like to know how everything could be done from the command line and a text editor.
I’ve also found this link that explains how to manually deploy a servlet to Tomcat,
http://linux-sxs.org/internet_serving/c292.html
but I couldn’t find any article telling how to deploy a web service.
Thanks a lot.
How to MANUALLY build and deploy a jax-ws web service to tomcat
I was trying to figure out how to MANUALLY build and deploy a web service for learning pourposes.
I began with this excellent article
http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
(new URL: http://www.oracle.com/technetwork/articles/javase/jax-ws-2-141894.html)
The idea was to do the whole thing using only a notepad and the command line.
The only way I could achieve was by deploying a web service with netbeans, and then having a look at the war generated file at \dist\.war (it’s just a zip file, you can open it with 7zip)
I leave this in case anybody is interested and for documentation purposes…
If anybody knows an easier way please let me know!!!
tested on:
saludos
sas
1. create the following dir
c:\java\src\ws2. create thew following file
c:\java\src\ws\Adder.java3. standing at
c:\java\src\ executefile
c:\java\src\ws\Adder.class will be generated4. create the following directory structure with the following files
5. copy compiled file
copy
c:\java\src\ws\Adder.classc:\tomcat6\webapps\adder_ws\WEB-INF\classes\ws\Adder.class6. c:\tomcat6\webapps\adder_ws\META-INF\context.xml
7. c:\tomcat6\webapps\adder_ws\WEB-INF\web.xml
8. Config
WEB-INF\sun-jaxws.xmlfile : c:\tomcat6\webapps\adder_ws\WEB-INF\sun-jaxws.xml
9. Copy libraries
files at c:\tomcat6\webapps\adder_ws\WEB-INF\lib
copy netbeans files from
and
10. restart apache
Shutdown : c:\tomcat6\bin\shutdown.bat
Startup : c:\tomcat6\bin\startup.bat
11. Test
Open a web browser and go to
http://localhost:8080/adder_ws/add?wsdlyou can also use a tool like soapui (http://www.soapui.org/) to test the web service
that’s it, I guess now I’ll have a look at the way eclipses does it…