Objectives
To look at one of the controversies ranging around "Web2.0" and "Web services" - REST vs SOAP.
Background
WWW
What in fact is it?
"The Web’s major goal was to be a shared information space through which people and machines could communicate.” - T. Berners-Lee WWW: Past, present, and future. IEEE Computer, 29(10), Oct. 1996, pp. 69–77
Needs addressed
- To share your own information.
- To access other people's information.
WWW innovations
- URL / URI (Uniform Resource Locator / Indicator)
- Unique WWW address for every resource.
- HTTP (Hyper Text Transfer Protocol)
- Protocol for transferring resource information between machines.
Request resource addressed by URI.
- Receive representation of that resource.
- In HTML, XML, text, whatever.
Formalization as REST
Roy Fielding's doctoral thesis, 2000
Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an 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. — Dr. Roy Fielding, Architectural Styles and the Design of Network-based Software Architectures
- Resources considered as "nouns".
- Unlimited in number.
- HTTP actions considered as "verbs" acting on the nouns.
- Restricted in number
- GET
- POST
- PUT
- DELETE
- Restricted in number
The schism - back to the past
- XML-RPC / SOAP (Remote Procedure Call / Simple Object Application Protocol / Service Oriented Application...)
- aka WSDL (Web Services Description Language) or even WS-*
- Verb-oriented
- Client requests service to carry out some operation.
- No limit to number of verbs possible.
- Verb-oriented
Example
- Analogy to programming languages.
- Nouns are data (variables).
- Eg, dog, employee, salary, birthday
- Verbs...
- REST
- get(dog), get(employee),..., post(salary), post(birthday),...
- exactly four (4) methods
- SOAP
- dogGet(), employeeGet(),..., salaryPost(), birthdayPost(),...
N methods
REST vs SOAP / WS-*
Web Services based on SOAP and WSDL are "Web" in name only. In fact, they are a hostile overlay of the Web based on traditional enterprise middleware architectural styles that has fallen far short of expectations over the past decade. - Nick Gall, VP Gartner
So what is the role of SOAP? SOAP is best utilized in closed systems (systems where all participants are known beforehand). In a closed system each participant can be customized to understand the APIs of the other participants and can be optimized for maximum efficiency. - Roger Costello
By the way, so why is anybody surprised that the open source community tends towards REST and big commercial interests tend towards SOAP? - Johannes Ernst's Blog
REST vs SOAP / WS-*
The Rebels vs. the Empire... The enemy keeps changing. Bloated 'enterprise' technology has constantly changed form to try and outwit us. First DCE, then CORBA, next J2EE and now: - Duncan Cragg
Resources
REST - Roger Costello
The S stands for Simple - Pete Lacey
How I Explained REST to My Wife - Ryan Tomayko
Representational_State_Transfer - Wikipedia
Roots of the REST/SOAP Debate - Paul Prescod
CategoryCLAW