Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Differences between Servlet and Web Service

 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

We have here an internal conversation about the subject. Therefore, what are the benefits of using Web Services and in particular Restlets instead of Servlets?

Regards,
Dan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am considering standardized web services, such as JAX-WS and JAX-RS:
As far as I am concerned, some important advantages with standardized solutions are:
- They have been tested.
- They are probably taking more things into consideration than I am able to do if designing a custom solution.
- They are documented.
- There are other people using these solutions that you can ask and share experiences with.
- They are often portable; there are several JAX-WS implementations etc.
Best wishes!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web services operate on a higher level than servlets, thus making it easier to implement advanced functionality. But note that almost all widely used WS implementations (Axis, CXF, JAX-WS RI, JAX-RS RI, Restlet) are implemented as web apps using the servlet API, so whatever you can do with those you can do with servlets directly - it's just way more work to implement.

I don't really agree with Ivan's list as a differentiator between "standard" WS APIs (like JAX-WS and JAX-RS) and other WS implementations (like Restlet, Axis and CXF). Those points apply to all frameworks I mentioned above to a large degree, not just the reference implementations.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ivan and Ulf.

Regards,
Dan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I don't really agree with Ivan's list as a differentiator between "standard" WS APIs (like JAX-WS and JAX-RS) and other WS implementations (like Restlet, Axis and CXF). Those points apply to all frameworks I mentioned above to a large degree, not just the reference implementations.

What I meant was that I only wanted to consider standardized solutions versus homebrewed solutions. The realm of other solutions may encompass things that I know little, or nothing, about - thus my reluctance to say anything about it.
Best wishes!
 
Samuel Behrman
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
The most obvious difference between Servlet and Web Service is:
You access servlet via HTTP while access Web Service via SOAP (Simple Object
Access Protocol).
But, in fact, you can not directly invoke a servlet, you can only open URL
connection and put some parameter to the servlet if the caller is out of
your application. And you can not restrict what parameters the caller can
put. The caller does not know what parameters your servlet can receive
either.
So, You'd better use web service to provide API to other applications, the
WSDL file of your web service can give the caller enough information to
invoke your web service.
I suggest you can learn more about web service.
Regards,
behrman.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic