2. REst = REpresentation State Tranfer
RestFul is a software architectural style
Stateless client-server architecture
Web Services are resources identify by an URL
e.g: www.mydomain.com/stock/GOOG
What are RestFul Web Services?What are RestFul Web Services?
4. Application description
WSDL vs. WADL (Web Application Description Language)
Transport Protocol
SOAP vs. HTTP
Discovery and publishing
UDDI vs. The Web (in general any url is a resource)
What are RestFul Web Services?What are RestFul Web Services?
Comparison with SOAP Web ServicesComparison with SOAP Web Services
5. RestFul vs. SOAP debateRestFul vs. SOAP debate
REST SOAP
Use HTTP transport protocol SOAP over HTTP
Point to point communication Designed to distributed systems...
Simpler specification Heavy specification. To much XML
flavors
Simple implementation Harder to develop
Any HTTP client will “work” Only SOAP clients
No require client API Must generate a SOAP client
6. RestFul vs. SOAP debateRestFul vs. SOAP debate
Companies are moving from SOAP web services to RestFul web
services
RestFul web services are coming more popular because they are
simpler to implement than SOAP
If you know HTTP you know Rest (My claim)...
Everything you can do with restful you can do it with SOAP...
7. Google Ajax API is now full restful with JSON output
Amazon offers SOAP and Restful interfaces. 80% developers are
using REST
Yahoo Restful API to access Yahoo Web Services
ESRI with ArcGIS Server with Map Services (Also support SOAP)
Does anyone knows another company that is using Rest?
Who is using Restful?Who is using Restful?
8. HTTP: Hyper Text Transport Protocol
HTTP work with two functions: REQUEST and RESPONSE (client-
server architecture)
Works over TCP/IP generally
A HTTP resource is identified by an URI
HTTP ReviewHTTP Review
14. JSONJSON ( JavaScript Object Notation)( JavaScript Object Notation)
Lightweight inter-change format
Language independent
Easy for humans and machine to read
“stock”: {
"lastestTrade":"2010-10-10T16:29:23.327-04:00",
"name":"Google Inc.",
"price":"415.5",
"symbol":"GOOG",
"volume":"200"
}
Stock.name = “GOOG”
http://www.json.org/
15. RESTFul Services
◦ JAX-RS 1.0 (JSR 311)
◦ Jersey framework
Client side
◦ JavaScript (JQuery 1.2)
◦ Java (HttpClient)
◦ Curl
◦ Any software/framework that supports HTTP and XML, JSON as response.
Others technologies (Server Side)
◦ Spring Framework 2.5 (Context of the Web Application )
◦ Hibernate/JPA (ORM to map the database – Model of the Application)
◦ Oracle 10g
RestFul Java APIRestFul Java API
16. JAX-RS: Java specification for RestFul Web Services (JSR 311)
JAX-RS provides a set of Java annotations that allows you to annotate your
POJO and give the Restful behavior
Restful implementation in JavaRestful implementation in Java
Annotation Description
@Path URI description
@GET, @POST, @PUT,
@DELETE
Method description. Use of java methods to denote how to acces
them
@Produces, @Consumes Define what is produced when a method is invoked. Consumes
define what is allow in the input
@PathParam Parameter in the URI. eg. /stock/{symbol}
@QueryParam Parameter /stock/GOOG?hidePrice=true
17. Jersey: Java Framework that implements JAX-RS
Servlet base framework
https://jersey.dev.java.net/
Restful implementation in JavaRestful implementation in Java
18.
NetBeans 6.8
Apache tomcat 6
Jersey and JAX-RS
Application demo: Stocks information
RestFul Web Services - DEMORestFul Web Services - DEMO