aspose file tools*
The moose likes Servlets and the fly likes Servlets vs Web Services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets vs Web Services" Watch "Servlets vs Web Services" New topic
Author

Servlets vs Web Services

John Gregory
Ranch Hand

Joined: Oct 05, 2006
Posts: 115
Not sure which group to post this to, so I'll start
here. I'm working on my SCWCD, so I've been learning
servlets & jsp. I'm hoping to use this technology at
work. However, the project I'm on uses web services.

Can anyone tell me the advantage of either...why would
I want to code a web service vice a servlet &/or a jsp?
Are there any good web readings that discuss these topics?

Thanks,

John Gregory
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Web services are often built using servlets so the subject of this thread doesn't make a lot of sense.

A web service (as opposed to a regular web page) is designed to be called by other programs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Web services have been a hot topic for serveral years with so much going on it is hard to keep up or to know where to start.

You might start at this Sun page explaining the state of Sun's Java tools for web services.

Bill
saurav sarkar
Ranch Hand

Joined: Jan 07, 2007
Posts: 180

i have not worked on web services.......but i think
its not right to compare these two.......as web services can
use servlets.....


Be Objectively Oriented.Explore the power of OOPs.
My Blog, Eclipse EMF Query committer.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

Isn't it true that web services are for websites to talk to each other in a linga franca and that the underlying technology may or may not be a servlet and may not even be Java-based but with web services.

Couldn't you have a servlet that is talking to .Net or to another servlet and that the point of web services is that you can communicate with other software that implements web services and not have to know what the other side is implemented with?

Kaydell
[ July 27, 2007: Message edited by: Kaydell Leavitt ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Kaydell Leavitt:
Isn't it true that web services are for websites to talk to each other in a linga franca and that the underlying technology may or may not be a servlet and may not even be Java-based but with web services.

Couldn't you have a servlet that is talking to .Net or to another servlet and that the point of web services is that you can communicate with other software that implements web services and not have to know what the other side is implemented with?

Kaydell

[ July 27, 2007: Message edited by: Kaydell Leavitt ]


All true.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Like Saurav Sarkar, I too feel that these topics are not very closely related.

Web Services are one of the xml based standards for making reusable services.The main transport was HTTP protocol so the word 'Web' has been associated with it , though now it supports many other transports.

Servlets are mainly for delegating the flow further for services invocation while the actual service would be somewhere , but not as part of the servlet code.That may be a web service , EJB or something else.
Another work of the servlet would be to direct the flow to the view with all the required data for generation of the final HTML response.
[ July 29, 2007: Message edited by: Rahul Bhattacharjee ]

Rahul Bhattacharjee
LinkedIn - Blog
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Isn't it true that web services are for websites to talk to each other in a linga franca


That is a rather limited view. There is no reason that client-side software - on your desktop, cellphone or whatever - can't talk to web services, and plenty do.

Bill
 
 
subject: Servlets vs Web Services