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 Rest vs Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Rest vs Web Service" Watch "Rest vs Web Service" New topic
Author

Rest vs Web Service

Sunil Gawade
Greenhorn

Joined: Oct 03, 2012
Posts: 28
Compare to WS Rest is having advantages in terms of simplicity in use. But still most of the development happening in WS. Is their any significant advantage or disadvantage between these 2 technologies ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
First, let's get the terminology right: Both REST and SOAP are WS. The http://www.coderanch.com/how-to/java/WebServicesFaq page has numerous comparisons of both approaches in the "What is REST?" section.
Sunil Gawade
Greenhorn

Joined: Oct 03, 2012
Posts: 28
Thanks I will go through it.
J Dirksen
Author
Greenhorn

Joined: Sep 04, 2012
Posts: 13
Ulf is right, both can be determined as being webservices. Normally, though, when you talk about webservices in teh enterprise world, people immediately assume your talking about SOAP/HTTP webservices. Webservices defined by a large number of specifications.

I don't really know whether most development is really done in the traditional WS-* space. In large organisation SOA is equivalent with SOAP/HTTP, and I agree, they still do a lot of SOAP/XML/XSD/WSDL type development. When you look outside the enterprise environment, however, you see people moving away from the often complex traditional webservice approach. Most 'services' on the internet are more often than not developed using a light-weight REST/JSON approach.

Both approaches have their advantages and disadvantages of course.
M Marin
Ranch Hand

Joined: Feb 20, 2010
Posts: 32
What about authentication? I have a clear picture for SOAP, but I still do not get it for Restful web services. Does anyone know any improvements for the last two years regarding secure communication in Restful? I would appreciate, since I may need it soon.

Marin.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
AFAIK, there is nothing in the works like WS-Security for REST. Unless you want to roll your own, that means Basic or Digest Authentication.
J Dirksen
Author
Greenhorn

Joined: Sep 04, 2012
Posts: 13
True, there is no standards based authentication/encryption/security framework available for REST, such as WS-Security for SOAP services. A lot of people say that since we got https that's enough for the encryption and integrity part and that with HTTP authentication we could handle the rest. You can probably fulfill most scenarios with these two technologies, but often https just isn't feasible or you want a different authentication method than just HTTP authentication.

It all really depends on your scenario. For integrity and authentication, for instance, you can add a simple HMAC to your message, calculated based on a shared key. If it's an API you're creating for third parties you can give out API keys that are sent with the request and tied to a specific host name. So for the authentication part there are a couple 'roll-your-own' solutions that are easy to implement. Encryption isn't something that is often done on the message level in JSON over REST, the only real option is using HTTPS. You could, if you really would like message based encryption use XML as the payload and use the standards for XML encryption.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rest vs Web Service