Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservice servlets

 
Sireesh Ganagam
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All ,

I am new to webservices . I am trying to understand Jax-ws , Jax-Rs

Till now my understanding is

we have top down , bottom up approaches. (wsgen ,wsimport) tools to generate in jax-ws.

Here my doubt is how does the request will (from wsgen , wsimport generated class , what is the role of servlet ) go when we do request like (Ex :http://localhost:8080/WebServicesExample/hello) .

what is the role of servlet or servlet container will do in both Jax-ws , jax-rs top down , bottom up approaches.


I really appreciate you guys help . I am sorry i can't format question correctly.

many many thanks in advance.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet should delegate to a service layer that invokes the web-service, handles the marshalling and returns a model.

The servlet can then do whatever it wants with the model object prior to returning to the view.

Just like database operations, keep the business logic out of the servlet and let dedicated service objects do their job.
(Must easier to test in a TDD environment also)

WP
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic