File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes RESTful Web Services:About the book 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 "RESTful Web Services:About the book" Watch "RESTful Web Services:About the book" New topic
Author

RESTful Web Services:About the book

Pallavi Srivastava
Ranch Hand

Joined: Dec 22, 2006
Posts: 38
Hi,

How is RESTful web service is different from normal java web service?
Do I have to learn some other technology to implement it?
What are the benefits of implementing a RESTful web service?

Thanks.
Leonard Richardson
author
Ranch Hand

Joined: Jun 08, 2007
Posts: 37
Pallavi,

REST is a different style of designing web services. In a typical
SOAP/WSDL service you expose to the network a small number of
"service" objects (usually one), and each object can expose a large
number of operations with custom names. A RESTful design is more
data-oriented. The dataset is exposed to the network through a large
number of standard HTTP objects called resources. Each resource
supports a small, standardized set of operations (GET, PUT, DELETE...)
that's always the same.

In a SOAP/WSDL service you devote your ingenuity to defining an API, a
set of operations your service will expose. In a RESTful design you
work on exposing your dataset through resources and connecting them
together. You might think of a RESTful web service as a data
structure, like a linked list, exposed to the network as a set of
interlinked Web pages.

The most basic advantage of a RESTful design is that it works more or less like the
World Wide Web. Most of the specific advantages follow from
this. For instance, you can build a client for a service with nothing
but an HTTP client library--there are lots of those for every language
and they all work the same way. Every resource has its own URI, which
means clients can pass around entry points into your service and
combine your service with others. Resources can link to each other,
which means the service can guide a client through a complex
multi-step operation. You can scale up your service using the standard
tools developed for websites: caching proxies, HTTP load balancers,
etc.

I could go on but I feel like I don't have the space here to defend
all these assertions (and Sam's better at it than I am). Hopefully
you get the picture. The book has more details on all these things,
especially in chapter 8 under "This Stuff Matters".

The big Java frameworks are not really capable of representing a
RESTful design, so you will have to learn a new framework. Right now,
the most popular RESTful Java framework is Restlet
(http://www.restlet.org/). JSR 311 will create a common ground for
RESTful frameworks in Java.
Leonard Richardson
author
Ranch Hand

Joined: Jun 08, 2007
Posts: 37
Oh, I should have added that you can implement a RESTful web service using nothing but the Servlet API, just as you can implement a client using only an HTTP library. And JAX-WS 2.0 can supposedly expose RESTful services. But no matter what, you'll have to change the way you think about web services. REST is a style, not a technology.
Pallavi Srivastava
Ranch Hand

Joined: Dec 22, 2006
Posts: 38
Thank you so much for sharing such a wonderful information.
I have recently started implementing web services in my project and would like to learn more about REST too.

Thanks & Regards.
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
REST is a different style of designing web services

Do I have to learn SOAP etc. in order to use REST? I have studied web services. Will REST help me design or maintain my website?
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
Sorry, I mean to say RESTful.
Leonard Richardson
author
Ranch Hand

Joined: Jun 08, 2007
Posts: 37
Sonny, learning about SOAP does nothing to help you learn about RESTful principles. Theoretically there could be overlap, but there actually isn't, at least right now.

To answer your other question, you can use the principles of REST to design a website that people use. It's not just for web services.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RESTful Web Services:About the book
 
Similar Threads
Question about setting Request Header for Rest web service
restful webservices
Testing restful web service
Passing an object from one server to another
Expose Database as Webservice