May 10, 2015
Web Services
(Legacy) System
Web Service API : 80
Web Services
(Legacy) System
Web Service API : 80
The Types of Web Services
Big Web Services
WS-Notification
WS-Security
WSDL
SOAP
REST
REST
RPC style
REST-RPC hybrid
RESTful Web Services
Representational State Transfer (REST) is a style of software architecture for
distributed hypermedia systems such as the World Wide Web. The term Representational
State Transfer was introduced and defined in 2000 by Roy Fielding in his
doctoral dissertation. Fielding is one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification
versions 1.0 and 1.1.
Bookings
Routes
Passengers
HTTPApplication
Bookings
Routes
Passengers
Resources
HTTPApplication
/booking/{id}/
/route/{id}/
/passenger/{id}/
POSTGETPUT
DELETE
Application
Resources
/booking/{id}/
/route/{id}/
/passenger/{id}/
POSTGETPUT
DELETE
Application
ResourcesAddressable
/booking/{id}/
/route/{id}/
/passenger/{id}/
POSTGETPUT
DELETE
Application
ResourcesAddressableUniform
Interface
/booking/{id}/
/route/{id}/
/passenger/{id}/
Application
GET /booking/123/
Addressable Resources
/booking/{id}/
/route/{id}/
/passenger/{id}/
Application
GET /booking/123/
State and Representation
Addressable Resources
/booking/{id}/
/route/{id}/
/passenger/{id}/
Application
GET /booking/123/
State and Representation
Addressable Resources
id: 123, pickupTime: ‘2010-12-13T09:00:00’, passenger: { link: { href: ‘/passenger/234’, rel: ‘related’ } }
200 OK
REST = HTTP Used Right
REST was “developed” in parallel with the HTTP/1.1 protocol
Caching and conditional GET
Proxies
HTTP headers (e.g.content negotiation)
HTTP methods
Everything Is a Resource
There shall be nothing else
Everything Is a Resource
There shall be nothing else
ROA
Everything Is a Resource
There shall be nothing else
•Version 1.0.3 of the software release•The latest version of the software release•Search results for the word ‘Galactica’•The next prime number after 1024•The relationship between Alice and Bob•A list of open bugs in the bug database
Clean and Descriptive URIs
Clean and Descriptive URIs
/software/releases/1.0.3.tar.gz/software/releases/latest.tar.gz/search/Galactica/nextprime/1024/relationships/Alice;Bob/bugs/by-state/open
State(lessness)
Application vs. Resource
The Uniform Interface
The Uniform Interface
GET - safe, idempotentPUT - idempotentDELETE - idempotentPOST - “complex”
The Uniform Interface
200 - OK201 - Created301 - Moved Permanently400 - Bad Request404 - Not Found409 - Conflict500 - Internal Server Error
Connectedness
route
booking
passenger
Hypermedia as the Engine of Application State
route
booking
passenger
Problems?
Transactions
Asynchronous tasks
Batch jobs
Relationships between resources
Partial updates
Partial representations
REST WS*
Ignores HTTPGood tool supportWSDL“Standards”Plethora of Security Standards
Embraces HTTPNo bandwidth overheadSimplicityWeb already is RESTfulHTTPS / HTTP Diges, OAuth
Why?