This post must be read when your webservice, realized with JAX-WS, is ready to go on deploy, but before to specify it in the web.xml.
To specify a JAX-WS webservice in the web.xml you must set a listener and a servlet, like this:
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>
WebServiceName
</servlet-name>
<servlet-class>
com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>
<load-on-startup>
1
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
WebServiceName
</servlet-name>
<url-pattern>
/urlPatternForWebService
</url-pattern>
</servlet-mapping>
Remember a very important thing: to include in your web-inf directory the sun-jaxws.xml file that contain the class that implement the web service. Ex.:
<?xml version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
<endpoint implementation="package.className" name="webServiceName" url-pattern="/webServicePattern"/>
</endpoints>
Great Article on Java Web Services. It good for learners
RispondiEliminaJava Web Services Online Training
Web Services Course
Web Services Training Courses
Java Web Services Training in Chennai