Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sun-jaxws.xml - When is it needed and when not?

I'm giving JAX-WS a high overview and noticed some references to sun-jaxws.xml (along with com.sun.xml.ws.transport.http.servlet.WSServletContextListener and com.sun.xml.ws.transport.http.servlet.WSServlet).

In what situations is this needed? (I think JSR 109 servers?!)

like image 784
JohnDoDo Avatar asked Sep 25 '12 11:09

JohnDoDo


People also ask

What is Sun Jaxws XML file?

sun-jaxws. xml is a proprietary deployment descriptor needed when web services are deployed as a standard WAR archive on a non-Java EE5 servlet container using the SUN's reference implementation.

What is JAX WS used for?

JAX-WS is a technology for building web services and clients that communicate using XML. JAX-WS allows developers to write message-oriented as well as RPC-oriented web services. In JAX-WS, a web service operation invocation is represented by an XML-based protocol such as SOAP.

What is web XML?

web. xml defines mappings between URL paths and the servlets that handle requests with those paths. The web server uses this configuration to identify the servlet to handle a given request and call the class method that corresponds to the request method.


1 Answers

sun-jaxws.xml is a proprietary deployment descriptor needed when web services are deployed as a standard WAR archive on a non-Java EE5 servlet container using the SUN's reference implementation.

Sun's RI uses WSServletContextListener as the listener for servlet context events and WSServlet as the dispatcher servlet; both of which have to be declared in web.xml. The sun-jaxws.xml file is then required to define web service end points for the WSServlet to let it know to which end point a service request must be dispatched.

In this way, web services can be run in any JAX-WS RI enabled servlet container, although they won't be portable.

Java EE 5+ compliant application servers such as Glassfish, the reference implementation, comply to JSR 109 (Web services 1.2/1.3) and JSR 224 (JAX-WS 2.0/2.1/2.2) and do not require non-standard sun-jaxws.xml deployment descriptors.

Please see here for more information:

http://jax-ws.java.net/nonav/2.2.1/docs/UsersGuide.html#1.0_Introduction

http://www.ibm.com/developerworks/java/library/j-jws9/index.html

like image 169
RGO Avatar answered Oct 03 '22 15:10

RGO