Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building and using REST information services Rion Dooley.

Similar presentations

Presentation on theme: "Building and using REST information services Rion Dooley."— Presentation transcript:

1 Building and using REST information services Rion Dooley

2 Outline What is REST? Why REST? Designing RESTful services Accessing RESTful services Example Demo Questions

3 What is REST? Stands for REpresentational State Transfer Defined by Roy Felding (Day Software, co- founder of Apache Software Foundation) "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. – Roy Felding

4 What is REST? Its a way of thinking about your enterprise. A concept, not a protocol Applies web architecture to web services. Model each document and process as a resource (noun) with a unique URI Use standard HTTP actions (verbs) to interact with a resource.

5 What is REST? GET: Retrieve a resource. No modification should be done. No side effects allowed. DELETE: Remove a resource POST: Create or update a resource PUT: Update a resource

6 Why REST? Scalable Human and machine usable Language agnostic Globally accessible resources Intuitively understandable URIs, resources, and actions.

7 Designing RESTful Services Implementing a style, not a protocol –Resources rather than services –Nouns rather than verbs Resource oriented design (ROD) What the enterprise is instead of what the enterprise does. Dont reinvent the wheel!!

8 Accessing RESTful Services REST is meant for interoperability. Built on same technology as the internet. Can be consumed in many different ways –Web browser –Web services –Lightweight clients –Command line (curl, wget) May be used by components of an SOA, but need not be a component in an SOA.

9 Designing RESTful Services Key Principals –Everything gets an ID –Link resources together –Use standard methods –Resources have multiple representations –Communicate statelessly

10 Example Simple User VO service –Authenticated –Gives user-specific information about a users profile, resources, accounts and jobs. –Output HTML and XML responses

11 Example Everything gets an ID A Resource has a unique URI. Sample endpoints may be: These are human-friendly for the example, but no real need for them to be so. -/profiles -/profiles/id -/resources -/resources/id -/accounts -/accounts/id

12 Example /profiles GET – list all user profiles PUT – unused POST – add a new user profile DELETE – unused /profiles/id GET – get user profile details PUT – update user profile POST – unused DELETE – delete user profile /resources GET – list all resources PUT – unused POST – add resource DELETE – unused /resources/id GET – get resource details PUT – update resource information POST - unused DELETE – delete resource /accounts GET – list all accounts PUT – unused POST – add account DELETE - unused /accounts/id GET – get account details PUT – update account details POST - unused DELETE – delete account Use standard methods

13 Example Representation based on request type Request for XML output Request for HTML output Could be any format you wish to support. GET /resources/forte HTTP/1.1 Host: Accept: application/xml GET /resources/forte HTTP/1.1 Host: Accept: text/html

14 Example Resources link together forte up 1212 jdoe1

15 Example Language and implementation details are up to the developer. Frameworks and APIs available in most popular languages REST is an architectural design, not a protocol, so work within your skill zone.


17 Links Roy Feldings dissertation – on/top.htm on/top.htm SOAP vs REST comparison paper – estws estws Security for REST web services presentation by Mark ONeill of Vordel – 06.pdf 06.pdf

18 Links Popular REST Frameworks in Java –Restlet ( –Axis 2.0 ( –Jboss RESTEasy ( –Apache CXF ( Popular REST Frameworks in other lang. –Ruby on REST( –Rest in Python ( –.NET

19 Links Familiar RESTful services –TeraGrid Info Services ( –Amazon Web Services ( –Yahoo! Web Services ( –Google Web Services ( Accessing REST services –Python:

20 Questions

Download ppt "Building and using REST information services Rion Dooley."

Similar presentations

Ads by Google