aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes What is com.sun.xml.ws.transport.http.servlet.WSServlet and any documentation on this. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "What is com.sun.xml.ws.transport.http.servlet.WSServlet and any documentation on this." Watch "What is com.sun.xml.ws.transport.http.servlet.WSServlet and any documentation on this." New topic
Author

What is com.sun.xml.ws.transport.http.servlet.WSServlet and any documentation on this.

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Hello All,

If not all, atleast in few of the examples I referred, I see com.sun.xml.ws.transport.http.servlet.WSServlet being declared in web.xml. I did not do this, when I deployed by application in GlassFish using eclipese (Dynamic Web Project). Apparently GlassFish must be providing a servlet implicitly, which I did not happen to see.

But what is com.sun.xml.ws.transport.http.servlet.WSServlet and I could not get any good information or API around this component. So, can some body point me to a link where I can read more about this.


Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I think this is the servlet that is responsible for directing incoming web service requests to the appropriate endpoint implementation class and to make any conversions/preparations needed before the endpoint appropriate implementation class is invoked.
With JAX-WS, this is taken care of "behind the scenes", as you correctly suspect. That is, when GlassFish encounters an endpoint implementation class, it knows it must use a WSServlet to handle incoming requests and thus it adds the servlet to the generated deployment descriptor etc. etc.
The only resource I was able to find being in a hurry was this:
http://www.google.com/codesearch/p?hl=en#V5msdoCsUcY/src/share/classes/com/sun/xml/internal/ws/server/package-info.java&q=WSServlet%20lang:java&sa=N&cd=6&ct=rc
Reading that you will at least get a feel for how incoming web service requests over HTTP are handled.
If someone has a better source for information, I would also be very interested!
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Thanks Ivan.

From your explanation and my understanding, can we consider this servlet as a part of Service Interaction layer, you described in "Endpoint Design and Architecture" in your notes. Also, this being a servlet I guess, it is possible to have the filters and listeners to be configured as any other web app. Though the functionality of filters can be achieved using Handlers in Jax-WS. What are your thoughts on this?

and this servlet seems to be implementation and container dependent. Because when I deployed an app, having this servlet configured in Tomcat 6, my tomcat startup failed, as there was a failure in initializing a listener. I wish Sun provides a better documentation on this servlet.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
There was some discussion on how to use the "raw" JAX-WS RI in Tomcat in http://www.coderanch.com/t/223670/Web-Services/java/Deploy-JAXWS-Mustang-WS-Tomcat. That involves configuring this servlet.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Kumar Raja wrote:From your explanation and my understanding, can we consider this servlet as a part of Service Interaction layer, you described in "Endpoint Design and Architecture" in your notes.

No, I would not say that this servlet is part of anything related to a specific service. As far as I am concerned, the servlet is part of the web service stack (Metro in this case).
As you correctly point out, the servlet is implementation and container dependent. If it were part of the service interaction layer then the service would have to be rewritten for every container I wished to deploy the service on.
Admitted, in reality there may still be things that affect portability in a negative manner.
Best wishes!
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Thanks Ivan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is com.sun.xml.ws.transport.http.servlet.WSServlet and any documentation on this.