Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes Webservice internals Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice internals" Watch "Webservice internals" New topic
Author

Webservice internals

Ram Murthy
Ranch Hand

Joined: Aug 02, 2005
Posts: 91
I am a beginer to WS and am working through some tutotrilas. I am using RAD to generate my service and client. The tutorials I am trying work fine but I have some questions...

1. Does WSDL get used during runtime
2. The Service bean gets mapped in the web.xml against the URL. Understand WS uses http protocol, so was curios how it works when the Service Bean does not implement HttpServlet. My understanding is when a class is mapped in servlet-class it should be a Servlet.

Thanks,
Ram


Cheers,
Ram
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
1. The use of the WSDL at runtime depends, as far as I understand, on what kind of client you develop.
It is possible to develop clients that assemble SOAP messages and send them without ever using the WSDL while other types of clients generates portable artifacts, like JAXB beans, at runtime, based on the WSDL. Then there is also the kind of clients which use wsimport or similar tool to generate artifacts at development time using the WSDL.
2. The fact that you see the endpoint address in the web.xml deployment descriptor is because your endpoint uses a servlet to receive requests, which are then passed on to your endpont implementation class.
Strictly speaking, this is not necessary, since the endpoint address is also present in the WSDL, so for endpoints that uses other protocols, there will be no web.xml.
Best wishes!
Ram Murthy
Ranch Hand

Joined: Aug 02, 2005
Posts: 91
1. The use of the WSDL at runtime depends, as far as I understand, on what kind of client you develop.
It is possible to develop clients that assemble SOAP messages and send them without ever using the WSDL while other types of clients generates portable artifacts, like JAXB beans, at runtime, based on the WSDL. Then there is also the kind of clients which use wsimport or similar tool to generate artifacts at development time using the WSDL.


I am genererating the client and service using RAD. The client is webproject as well, in that case does the WSDL get used at runtime. I have a feeling it does not since WSDL defines the service and using WSDL we generate the service and clients. A bunch of classes get created proxy, ser, desser etc..I am assuming these classes take care of the runtime and WSDL is not needed at runtime...atleast in my case.

2. The fact that you see the endpoint address in the web.xml deployment descriptor is because your endpoint uses a servlet to receive requests, which are then passed on to your endpont implementation class.
Strictly speaking, this is not necessary, since the endpoint address is also present in the WSDL, so for endpoints that uses other protocols, there will be no web.xml.


Where can I see the servlet(the class which extends HttpServlet) does that get generated, even then I am confused because in the web.xml the servlet-class attribute points to the service bean which is not a servlet. Once the http request is recieved it pure J2EE ...so it will invoke the service bean and find it is not a servlet. Wouldn' that lead to failure....


Also another question for those who use RAD IDE, how do I know if I am using JAX-WS or JAX-RPC ??
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Regarding the <servlet-class> element in web.xml, check section 3.8.1 here: http://java.sun.com/blueprints/guidelines/designing_webservices/html/webservdesign9.html
Ram Murthy
Ranch Hand

Joined: Aug 02, 2005
Posts: 91
Thanks that helped but I am not fully clear... probably let me state where my confusion..

1. In the service project on the web.xml the <servlet-class> is mapped as the service bean which is a regular java class does not extend HttpServlet. Is that allowed as per J2EE standards.

2. If yes then probably the server runtine in tandem with webservices.xml directs the httprequest to the service bean..is that a correct assumption.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
My answers are as follows:
1. Yes.
2. Yes.

As a reference, see for instance section 10.1.2 in the JAX-RPC specification, version 1.1.
Note that the JAX-WS specification does not talk about servlet based endpoints, only about endpoints running in a servlet container. I suspect it is in order to give web service stack implementations more freedom on how to handle the implementation details.
Best wishes!
Ram Murthy
Ranch Hand

Joined: Aug 02, 2005
Posts: 91
Thanks a bunch....I got a Halo now -
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webservice internals
 
Similar Threads
Cannot call Spring WS
Spring: Creating a servlet/controller to handle REST calls
threading in JSE
Generate stubs for EJB3.1 bean exposed as webservice
doubts regarding jax-ws and web service broker pattern