1
votes

pls consider my question based on JEE 5 and JDK 7, and web server is tomcat 6;

consider that we have a web service like this :

package client;

import javax.jws.WebService;

@WebService
public class RetroQuery {
    public List<RetroQueryOutput> retroQuery(RetroQueryInput req) throws Exception {
    }
}

in weblogic and WAS we can create a JAX-WS web service with below only configuration in web.xml, that NO! need to use sun-jaxws.xml file.

<servlet>
    <servlet-name>RetroQueryPort</servlet-name>
    <servlet-class>client.RetroQuery</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>RetroQueryPort</servlet-name>
    <url-pattern>/RetroQueryPort</url-pattern>
</servlet-mapping>

but in a web container, we need to make web.xml a little bit different like below :

<listener>
      <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
    <servlet-name>RetroQueryService</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>RetroQueryService</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

AND on top of this we need also a file named sun-jaxws.xml with below kinda content :

<endpoint name='RetroQuery' implementation='client.RetroQuery' url-pattern='/RetroQueryPort' />

Question 1: what conponent/standart in JEE 5 (weblogic or WAS) makes "com.sun.xml.ws.transport.http.servlet.WSServlet " class and listener useless

Questions 2: why web servers (tomcat 6) is not working without setting servlet class with "com.sun.xml.ws.transport.http.servlet.WSServlet" and without putting this sun-jaxws.xml file

PS. I am also aware in JEE 6 there is a new component javax.servlet.ServletContainerInitializer but what I am wondering is something different.

1

1 Answers

0
votes

Jax-WS is Sun's reference implementation for creating/implementing/calling web services. To use Jax-WS in a non-JEE environment,you need sun-jaxws.xml deployment descriptors. More details here

It is a different story if you use CXF instead of Sun's Jax-WS RI.