- Back to Home »
- Web Services »
- SOAP Web Services vs REST Web services
(lets face it you use soap to wash, and you rest when your tired)
What is REST?
REST is an architectural style which is based on web-standards and the HTTP protocol. REST was first described by Roy Fielding in 2000.
In a REST based architecture everything is a resource. A resource is accessed via a common interface based on the HTTP standard methods. In an REST architecture you typically have a REST server which provides access to the resources and a REST client which accesses and modify the REST resources. Every resource should support the HTTP common operations. Resources are identified by global ID's (which are typically URIs).
REST allows that resources have different representations, e.g. text, xml, json etc. The rest client can ask for specific representation via the HTTP protocol (Content Negotiation).
Who's using REST?
All of Yahoo's web services use REST, including Flickr, del.icio.us API uses it, pubsub, bloglines, technorati, and both eBay, and Amazon have web services for both REST and SOAP.
Who's using SOAP?
Google seams to be consistent in implementing their web services to use SOAP, with the exception of Blogger, which uses XML-RPC. You will find SOAP web services in lots of enterprise software as well.
RESTFul webservices
A RESTFul webservices is based on the HTTP methods and the concept of REST. It typically defines the base URI for the services, the MIME-types its supports (XML, Text, JSON, user-defined,..) and the set of operations (POST, GET, PUT, DELETE) which are supported. JAX-RS supports the creation of XML and JSON via JAXB.
REST vs SOAP
The main advantages of REST web services are:
* Lightweight - not a lot of extra xml markup
* Human Readable Results
* Easy to build - no toolkits required
SOAP also has some advantages:
* Easy to consume - sometimes
* Rigid - type checking, adheres to a contract
* Development tools
Everything (Every Resource) has an ID
• ID is a URI
http://example.com/widgets/foo
http://example.com/customers/bar
http://example.com/customers/bar/orders/2
http://example.com/orders/101230/customer
Example URI
• Define how the URI maps to your resources
What is REST?
REST is an architectural style which is based on web-standards and the HTTP protocol. REST was first described by Roy Fielding in 2000.
In a REST based architecture everything is a resource. A resource is accessed via a common interface based on the HTTP standard methods. In an REST architecture you typically have a REST server which provides access to the resources and a REST client which accesses and modify the REST resources. Every resource should support the HTTP common operations. Resources are identified by global ID's (which are typically URIs).
REST allows that resources have different representations, e.g. text, xml, json etc. The rest client can ask for specific representation via the HTTP protocol (Content Negotiation).
Who's using REST?
All of Yahoo's web services use REST, including Flickr, del.icio.us API uses it, pubsub, bloglines, technorati, and both eBay, and Amazon have web services for both REST and SOAP.
Who's using SOAP?
Google seams to be consistent in implementing their web services to use SOAP, with the exception of Blogger, which uses XML-RPC. You will find SOAP web services in lots of enterprise software as well.
RESTFul webservices
A RESTFul webservices is based on the HTTP methods and the concept of REST. It typically defines the base URI for the services, the MIME-types its supports (XML, Text, JSON, user-defined,..) and the set of operations (POST, GET, PUT, DELETE) which are supported. JAX-RS supports the creation of XML and JSON via JAXB.
REST vs SOAP
The main advantages of REST web services are:
* Lightweight - not a lot of extra xml markup
* Human Readable Results
* Easy to build - no toolkits required
SOAP also has some advantages:
* Easy to consume - sometimes
* Rigid - type checking, adheres to a contract
* Development tools
Everything (Every Resource) has an ID
• ID is a URI
http://example.com/widgets/foo
http://example.com/customers/bar
http://example.com/customers/bar/orders/2
http://example.com/orders/101230/customer
Example URI
• Define how the URI maps to your resources