• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advantages of RESTful web services ?

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I just got familiar with the development of web services using REST and JAX-RS.

It seems to me that the development of web services is faster this way.

However I am wondering what the other advantages are, compared to other standards (JAX-WS, JAX-RPC ...)

In which cases do you recommend the development of web services using REST ?
On the contrary, when is it not recommended to use REST ?

Thanks for your input.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The http://faq.javaranch.com/java/WebServicesFaq links to a number of articles that address this topic in the "What is REST?" section.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
REST has advantages when:
- You have a set of resources that you want to manipulate.
- You want to support navigation between resources.
For instance, when placing an order, you receive an URI to an order confirmation resource for the order in question. Before having confirmed the order, you may even want to modify it - something that can be done with the URI of the order received when placing the order. When having confirmed the order, you receive an URI to a payment service. After having paid the order, you receive an URI to an order status resource for the order in question.
- You need scalability.
RESTful web services are tyically stateless and therefore easily scalable.
SOAP web service should also typically be stateless.
- You want to improve performance by caching web service request results at some point between the service and the consumer.
Caching on the URI of a service is very easy.

SOAP has advantages when:
- You want to publish a web service description (using WSDL).
WSDL 2 can describe RESTful web service as well. WADL is an alternative to WSDL for RESTful web services.
- You want to use security etc. that relies on the use of SOAP headers or some similar mechanism in which data is added and removed from a request.
- You want better tooling support.
- You want tested platform interoperability.
This does not mean that interoperability between platforms is easy. It just means that someone has tested it using certain web service stacks.

This is what I can think of right now. It would be interesting to hear about some other advantages/disadvantages.
Personally I feel that there is room for both SOAP and REST in my toolbox.
Best wishes!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic