JAX-RS – REST in Java.

Slides:



Advertisements
Similar presentations
RESTFul Web Services The Easy Way. What is REST? Representational State Transfer Maps your CRUD actions to HTTP verbs ActionVerb CreatePOST RetrieveGET.
Advertisements

Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Behzad Samin 0 An End-to-End Overview of a RESTful Web Service.
CollectionSpace Service Behind the scenes June 2009 Face-to-face Sanjay Dalal U.C. Berkeley IST/Data Services.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
6 Copyright © 2005, Oracle. All rights reserved. Using Advanced Techniques in Servlets.
Representational State Transfer (REST): Representing Information in Web 2.0 Applications this is the presentation Emilio F Zegarra CS 2650.
Building and using REST information services Rion Dooley.
Practical Uses for Web Services in Application Express
Introduction to Web Services
Distributed Information System December 7, 20091Alvin MACCHIONE - Rémy JAVELLE.
CIS* Service-Oriented Computing
Web Services with Apache CXF
Server Access The REST of the Story David Cleary
How to Build a REST API Using ASP.NET Web API Fernando Cardenas 10/8/20131.
Web Service Testing RESTful Web Services Snejina Lazarova Dimo Mitev
Written by Liron Blecher
OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
RESTful Web Services Senthil Chinnaiyan, Senior Architect
By Loukik Purohit & Rohit Ghatol
31242/32549 Advanced Internet Programming Advanced Java Programming
Francisco Gonzalez Mario Rincon.  Apache CXF is an open source services framework.  CXF helps you build and develop services using frontend programming.
Building RESTful Interfaces
1 Servlets Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun.
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
Servlets and a little bit of Web Services Russell Beale.
© 2011 IBM Corporation Overview on Modeling RESTful Services August, 2011 Manoj Paul, Software Developer, Rational,
1 Web Service Implementation, Deploy and Test 课程名:以服务为中心的软件开发设计与实现.
Prepared By : Monika Darji Web Services using REST & JAX-WS.
The New Zealand Institute for Plant & Food Research Limited Matthew Laurenson Web Services: Introduction & Design Considerations.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
Or, Hey can’t we just do it using HTTP for the envelope?
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
RESTful Web Services.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
INTEGRATION OF BACKBONE.JS WITH SPRING 3.1. Agenda New Features and Enhancements in Spring 3.1 What is Backbone.js and why I should use it Spring 3.1.
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
1 ADO.NET Data Services Mike Taulty Developer & Platform Group Microsoft Ltd
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
RESTful Web Services What is RESTful?
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Lecture IV: REST Web Service
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Programming for RESTful-SOA An introduction to building a SOA System with light-weighted RESTful Web Services (Web Services without SOAP or WSDL) Xiong.
Introduction to Servlets
CS3220 Web and Internet Programming RESTful Web Service
GF and RS, Dept of CS, Mangalore University
Better RESTFul API – Best Practices
Data Bridge Solving diverse data access in scientific applications
WEB SERVICES.
Node.js Express Web Services
GF and RS, Dept. of CS, Mangalore University
The J2EE Framework Java Technologies External Application.
WEB API.
DWR: Direct Web Remoting
Servlet APIs Every servlet must implement javax.servlet.Servlet interface Most servlets implement the interface by extending one of these classes javax.servlet.GenericServlet.
$, $$, $$$ API testing Edition
Developing and testing enterprise Java applications
CS4961 Software Design Laboratory Understand Aquila Backend
Techniques to Invoke Web Services from SAS
Web-Services and RESTful APIs
WCF Data Services and Silverlight
.NET Framework V3.5+ & RESTful web services
THE WEB AND WEB SERVICES
Presentation transcript:

JAX-RS – REST in Java

Agenda Introduction Compare to SOAP Server code Client code Frameworks

Introduction Representational state transfer (Roy Fieding) Every URL represents an object or a state Who uses it? Amazon AWS (EC2, S3, etc.) Flickr Del.ici.ous Ebay CRUD by HTTP methods Create → POST Read → GET Update → PUT Delete → DELETE

Compare to SOAP REST advantages SOAP advantages Lightweight - not a lot of extra xml markup Human Readable Results Easy to build - no toolkits required SOAP advantages Easy to consume – sometimes Rigid - type checking, adheres to a contract Development tools

Server code Servlet API web.xml mapping doGet, doPost, doUpdate, doDelete Payload marshalling/unmarshalling Example JSR-311 (JAX-RS)

JAX-RS features Annotation based Deployment HTTP Data handling JAX-RS aware container javax.ws.rs.Application Servlet container Servlet Filter J2SE RuntimeDelegate.createEndpoint HTTP Data handling @Provider

JAX-RS HTTP Templated mapping and subresources MIME handling @Path MIME handling @Provides, @Consumes HTTP methods @GET, @POST, @UPDATE, @DELETE, @HEAD, @OPTIONS, @HttpMethod Caching evaluatePreconditions

JAX RS data handling URI templates Parameters Return values Resporse {name} {regex} Parameters @PathParam @QueryParam @FormParam @MatrixParam @HeaderParam @SessionParam @UriInfo @Encoded @CoockieParam @DefaultValue No annotation (entity) Return values Resporse GenericEntity Null Status 204 Entity (marshalled) Exceptions WebApplicationException Unchecked Filters, error pages Checked ServletException, WebServiceException @Provider extends ExceptionMapper

Entities Primitives String enum byte [], File, DataSource, etc. JAXB valueOf List, Set, SortedSet – not worked for me :-( @Provider MessageBodyReader MessageBodyWriter

Client code Old school – javascript, HttpClient REST oriented APIs No standard spec Framework offer good APIs org.jboss.resteasy.client.core com.sun.jersey.api.client

Frameworks Jboss resteasy Sun jersey CXF Axis2 Spring Others?

Q & A

Thank you