aspose file tools*
The moose likes Web Services and the fly likes Advantages of RESTful web services ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Advantages of RESTful web services ?" Watch "Advantages of RESTful web services ?" New topic
Author

Advantages of RESTful web services ?

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
The http://faq.javaranch.com/java/WebServicesFaq links to a number of articles that address this topic in the "What is REST?" section.


Ping & DNS - my free Android networking tools app
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advantages of RESTful web services ?