• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advantages of RESTful web services ?

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • 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.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic