8. REST Overview APIs based on the Representational State Transfer (REST) architecture dominate web 2.0 mash-up and social media development. There are a number of frameworks available that support the development of RESTful APIs (WCF, JAX-RS, Wicket, Zend) We are still missing an established mechanism for documentation and discovery and client-side tool support for rapid implementation.
9. REST Overview REST-style architectures consist of clients and servers. Requests and responses are built around the transfer of "representations" of "resources". A resource is any entity that can be addressed in a URI (an account, an employee, a physical file) A representation of a resource is any information that captures the current or intended state of a resource. All information necessary to process and complete a request is contained within it.
10. Example Resource (Twitter Public Timeline) http://twitter.com/statuses/public_timeline.xml Resource (Twitter User) http://twitter.com/users/petermorano.xml
11. REST Overview REST-style architectures consist of clients and servers. Requests and responses are built around the transfer of "representations" of "resources". A resource is any entity that can be addressed in a URI (an account, an employee, a physical file) A representation of a resource is any information that captures the current or intended state of a resource. All information necessary to process and complete a request is contained within it.
12. Wait a Minute If this sounds a lot like the Web, it’s because the Web is a REST implementation Roy Fielding, who created REST, was also one of the principal authors of HTTP
20. URI Examples GET http://www.example.com/v1/employees GET http://www.example.com/v1/employees/1824 POST http://www.example.com/v1/employees PUT http://www.example.com/v1/employees/1513 DELETE http://www.example.com/v1/employees/1222
39. REST Cons Must be HTTP No Atomic Transactions No Standards for security except HTTPS No Standardized Discovery
40. REST vs. SOAP Unlike SOAP-based web services, there is no "official" standard for RESTful web service. Though not a standard, a RESTful implementation uses standards like HTTP, URL, XML, GIF, etc.
73. WADL Web Application Discovery Language (WADL) Created in 2005 by Marc Hadley of Sun Microsystems Submitted to W3C on 8/31/2009 REST’s Answer to WSDL Specification: https://wadl.dev.java.net/
74. What WADL Gets You Reduced Errors in Discovery Opportunities for Code Generation Spend more time building your application and less time implementing APIs
75. So Where Is It? Currently in Submission to W3C API Providers are slow to adopt, so tool providers are slow to implement There are projects underway to generate code from WADL, and at least one tool that helps in creating WADL
76. WADL Demo Project on code.google.com Online Version: http://tomayac.de/rest-describe/latest/RestDescribe.html