Deploying the JAX-WS Web Service on Tomcat

After remarking Java 6 includes javax.xml.ws, I can create a standalone web service. How do I go to hosting in Tomcat 6?

+6
java web-services tomcat jax-ws
source share
3 answers

Download the metro from here and run this jar as

java -jar metro-2_0-ea.jar 

The metro directory contains two ant files, metro-on-glassfish.xml and metro-on-tomcat.xml. These two files are used to install Metro binary files into their respective web containers.

Installation process for Tomcat:

  • shutdown.bat (shutting down Tomcat)

  • Run the following line at the command prompt

ant -Dtomcat.home = -f / metro-on-tomcat.xml install

startup.bat (launch Tomcat)

the installation process copies two jar Metro files to the Tomcat shared / lib directory. No Tomcat configuration files.

+4
source share

You need to download the JAX-WS RI (Reference Implementation) jax-ws.dev.java.net. The https://jax-ws.dev.java.net/nonav/2.1.2m1/docs/samples.html page lists some tips at the bottom of the page for setting up Tomcat for JAX-WS RI.

In particular, for Tomcat 6 you need:

Change $ CATALINA_HOME / CONF / catalina.properties and set shared.loader = {Install RI Directory} / Lib / *. Jar. If you are running multiple instances of Tomcat, then edit CATALINA_BASE / CONF / catalina.properties for this particular case. The same method can be used with Tomcat 5.x if you do not like to copy all the banks to $ CATALINA_HOME / shared / lib

+4
source share

Or you can use Apache CXF , which is a full-featured implementation of JAX-WS. No additional configurations - just one servlet.

+2
source share

All Articles