Execution Environments for Distributed Computing SOAP VS REST EEDC 34330 Master in Computer Architecture, Networks and Systems - CANS Homework 2 number: 53 Hui Shang [email_address]
REST VS SOAP WEB SERVICE
What is SOAP?
What is REST?
REST VS SOAP
References and Questions
What is SOAP(1)?
SOAP -> operation-oriented
SOAP is a protocol for exchanging XML-structured information in the implementation of Web Services in computer networks.
SOAP once stood for 'Simple Object Access Protocol' but this acronym was dropped with Version 1.2 of the standard. (Since people realize it is not simple, not necessarily object-oriented programming…)
envelope : Define what is in the message and how to process it
encoding rules : Express instances of application-defined data types
convention : Represent procedure calls and responses.
What is SOAP(2)?
A SOAP message with the parameters needed could be sent to a web site that has web services enabled, the site would then return an XML-formatted document with the resulting data.
Extensibility : WS-security and WS-routing
Neutrality : SOAP can be used over any transport protocol such as HTTP, SMTP,JMS or evenTCP
Independence : SOAP allows for any programming model
What is a REST Web Service(1)?
Representational state transfer (REST) -> Resource oriented
client -> resource -> representational state
resource : any coherent and meaningful concept that may be addressed.
representation of resource : a document that captures the current or intended state of a resource.
transfer : While making new request, the client is considered to be in transition.
What is a REST Web Service(2)?
REST basically means that each unique URL is a representation of some object. The user can use HTTP GET to get the content and use HTTP POST, PUT, or DELETE to modify the object (in practice most of the services use a POST).
a network of web pages, where the user progresses through the application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use.
What is a REST Web Service(3)?
Client–server : A uniform interface separates clients from servers. Servers and clients may be replaced and developed independently.
Stateless: Client requests are not stored on the server. This makes servers more reliable and scalable. (requests independent->load balance)
Safety /Idem potence : GET/DELETE many times = once
Cacheable : Caching can eliminates some client–server interactions, further improving scalability and performance. (HTTP->cache server)
Layered system : Intermediary servers may improve system scalability and enforce security policies. (proxy server->security policy)
REST VS SOAP(1)
Client 1 can perform all operations, while client 2 can only do the query user and query user list. How to implement this web service?
REST VS SOAP(2)
Uses the existing features of the HTTP protocol, allows existing layered proxy and gateway to perform additional functions.
ex: HTTP caching, security enforcement
Encourages the defining of new vocabulary which overlaid onto the HTTP POST verb, this may disregards many of Http's existing capabilities (authentication , caching…) reinvents these features within new vocabulary.
REST VS SOAP(3)
Who's using REST?
Web services now using REST: Twitter, Yahoo, others include Flickr, del.icio.us, pubsub, bloglines, technorati…
Who's using SOAP?
Google web services, with the exception of Blogger, which uses XML-RPC. And also lots of enterprise software…
EBay and Amazon have web services for both REST and SOAP.
Web API protocol war : SOAP VS REST(3)
The distribution of the different API protocols and styles
It’s based on ProgrammableWeb’s directory of more than 2,000 web APIs.