2. What is REST?
● REpresentational State Transfer
● Lightweight, ClientServer architecture
● Interactions are based on the transfer of
resource state representations
● Systems exchange state representations and
perform application state transitions
● Mostly implemented using HTTP but can be
based on other protocols
3. Origin and Growth
● First introduced by Roy Fielding in his doctoral
dissertation
● Developed in parallel with HTTP/1.1
● WWW is the largest known implementation of a
RESTful architecture
● Widely used in modern days as an alternative to
technologies like CORBA and SOAP
4. REST By Example...
● Learning Management System for a school
● A number of fundamental concepts
● Student
● Course
● Teacher
● In a RESTful design these concepts are likely to
become the 'resources' managed by the LMS
8. Application State
● Applications have states
● Number of students in the system
● Number of associations between students and
courses
● Number of teachers
● Application state transitions may occur as a
result of a resource state transfer
● Application state can also be represented using
some data format or hyper text references
9. Representational State Transfer
● Clients and servers interact with each other by
exchanging
● Resource state representations
● Application state representations
● Other control information
11. Why HTTP?
● Rich vocabulary and powerful tools that are
ideal for representing resource states,
application states and control data
● Application state – Status code + Links
● Resource state – HTTP entity
● Control data – HTTP method
● CRUD operations map nicely into HTTP
methods
13. Advantages
● Simple and lightweight
● Easy to implement
● Very little processing at the application level
● Small amount of data to pass around
● Support any content type
● Leverage builtin application layer protocol
semantics without reinventing the wheel
14. Notable Deployments
● Amazon AWS (Over 90% of the clients are
using the RESTful API)
● Google Maps
● Yahoo!
● eBay
● Sastry Malladi on service orientation
http://www.youtube.com/watch?v=O9osZGXDok
15. WSO2 ESB
● A lightweight, highperformance ESB
● Feature rich and standards compliant
● SOAP and WS* standards
● REST support
● Variety of protocols and message formats
● User friendly and highly extensible
● 100% free and open source with commercial
support
16. Under the Hood
● WSO2 ESB is based on a number of well
known Apache projects
● Synapse http://synapse.apache.org
● Axis2 http://axis.apache.org/axis2/java/core
● Web Services http://ws.apache.org
● REST support of WSO2 ESB stems from the
REST support offered by Axis2
17. REST Support in Axis2
● Axis2 provides a REST binding for each
deployed web service
● This enables clients to invoke any Axis2 service
via REST calls
● GET /services/HelloService/sayHello
● GET /services/MathService/add?a=5&b=10
18. REST Support in WSO2 ESB
● WSO2 ESB can receive and mediate REST
calls just like any other request
● The same mediators that work with SOAP can
be used to manipulate REST invocations
● Log, Send, Filter, Switch, XSLT, DBLookup....
● Additional handles provided by the ESB in the
form of properties
● Easily switch between SOAP and REST
30. REST APIs
● An API is similar to a web application hosted on
the ESB
● Anchored at a specific URL path (context)
● /test
● /dictionary
● /foo/bar
● Can be bound to a specific host and a port
● Contains one or more resources
31. Resources
● A RESTful resource exposed over HTTP
● Similar to a proxy service but focuses on REST
● Can be associated with
● A set of HTTP methods
– GET only, GET and POST only, All HTTP methods
● A specific content type
– application/xml, application/json
● A particular class of clients (user agents)
32. Dispatching Requests to a Resource
● URL patterns
● RegEx match (/test/*)
● Extension match (*.jsp)
● Exact match (/test/index.jsp)
● URI templates
● /dictionary/{character}/{word}
● /accounts/{accountId}/{operation}
37. API Management Goals
● Service provider objectives
● Define APIs
● Define security requirements and SLAs
● Monitor API usage and SLAs
● Service consumer objectives
● Discover and browse APIs
● Sign up and obtain API keys
● Consume APIs using the obtained keys
● Monitor API usage and SLAs
40. Summary and Recap
● REST is a lightweight, clientserver architecture for building
distributed systems
● RESTful designs are concerned with resources, states and
transfer of representational state between systems
● WSO2 ESB provides excellent support for receiving, processing
and intermediating REST (HTTP) calls
● The new API concept is a powerful feature which allows
developers to define REST APIs in the ESB without writing any
additional code
● WSO2 platform is ideally suited for developing comprehensive and
flexible API management solutions based on open standards
43. WSO2 Engagement Model
● Quick Start
● Development Support
● Development Services
● Production Support
● Turnkey Solutions
● WSO2 Mobile Services Solution
● WSO2 FIX Gateway Solution
● WSO2 SAP Gateway Solution