Pierre-Johan CHARTRE pierre-johan.chartre@logica.com Java EE - JAX-RS - Pierre-Johan CHARTRE pierre-johan.chartre@logica.com.

Slides:



Advertisements
Similar presentations
System Wide Information Management (SWIM)
Advertisements

REST - Representational State Transfer
Representational State Transfer (REST): Representing Information in Web 2.0 Applications this is the presentation Emilio F Zegarra CS 2650.
Service Oriented Architecture
REST Vs. SOAP.
Building and using REST information services Rion Dooley.
Introduction to Web Services
JAX-RS – REST in Java.
Server Access The REST of the Story David Cleary
REST (Representational State Transfer)
Written by Liron Blecher
RESTful Web Services Senthil Chinnaiyan, Senior Architect
BCS Teesside Web Services David Fuller. What I will cover What are Web Services? What is SOA? What is BPEL? Demonstrate the construction of a web service.
Overview of Web Services
What are Web Services? How to use them?
WEB SERVICES. FIRST AND FOREMOST - LINKS Tomcat AXIS2 -
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Services Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Presentation 7 part 2: SOAP & WSDL.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Building RESTful Interfaces
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
Semantic Web Introduction
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
SOAP, WSDL & introduction to UDDI
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
CSE 636 Data Integration Web Services.
Peoplesoft: Building and Consuming Web Services
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
© 2011 IBM Corporation Overview on Modeling RESTful Services August, 2011 Manoj Paul, Software Developer, Rational,
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Presentation 7: Part 1: Web Services Introduced. Outline Definition Overview of Web Services Examples Next Time: SOAP & WSDL.
Prepared By : Monika Darji Web Services using REST & JAX-WS.
Message Driven Beans & Web Services INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Or, Hey can’t we just do it using HTTP for the envelope?
1 Seminar on Service Oriented Architecture Principles of REST.
Web Services (SOAP) part 1 Eriq Muhammad Adams J |
Service Oriented Programming 1 Javier Espinosa, PhD
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
Introduction to Web Services Presented by Sarath Chandra Dorbala.
© 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.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
WEB SERVICES.
REST: Web Services Abel Sanchez.
Unit – 5 JAVA Web Services
GF and RS, Dept. of CS, Mangalore University
Representational State Transfer
Introduction to Web Services and SOA
WEB API.
$, $$, $$$ API testing Edition
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Distributed System using Web Services
Introduction to Web Services and SOA
Week 05 Node.js Week 05
Distributed System using Web Services
WCF Data Services and Silverlight
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Pierre-Johan CHARTRE pierre-johan.chartre@logica.com Java EE - JAX-RS - Pierre-Johan CHARTRE pierre-johan.chartre@logica.com

Web-services Definition: “A Web service is a method of communication between two electronic devices over the World Wide Web.” Wikipedia Web service is "a software system designed to support interoperable machine-to-machine interaction over a network.“ W3C

Web-services Definition: A Web service has an interface described in a machine-processable format (specifically Web Services Description Language, aka WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.

Service-Oriented Achitecture

Service-Oriented Achitecture SOA is a set of principles and methodologies for designing and developing software in the form of interoperable services. These services are well-defined business functionalities that are built as software components that can be reused for different purposes.

SOA example

SOA example

Web-services Definition: W3C has identified 2 major classes of Web services REST-compliant Web services the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of stateless operations; It’s the Web (2.0) API a defined set of HTTP request messages along with a definition of the structure of response messages, typically expressed in JSON or XML.  Arbitrary Web services  the service may expose an arbitrary set of operations

SOAP Web-services See http://en.wikipedia.org/wiki/SOAP

REST Web-services REST: Representational State Transfert is a style of software architecture for distributed systems such as the WWW. REST has emerged as a predominant Web-service design model. REST was first described by Roy Fielding in 2000. It’s a resource-oriented Web-service

REST Web-services Architecture definition In a REST based architecture everything is a resource. A resource is accessed via a common interface based on the HTTP standard methods. In a REST based architecture you typically have a REST server which provides access to the resources and a REST client which accesses and modify the REST resources. REST  is designed to use a stateless communication protocol, typically HTTP. REST allows that resources have different representations, e.g. text, xml, json etc. The rest client can ask for specific representation via the HTTP protocol (content negotiation).

REST Web-services HTTP methods GET defines a reading access of the resource without side-effects. The resource is never changed via a GET request, e.g. the request has no side effects (idempotent). PUT creates a new resource, must also be idempotent. DELETE removes the resources. The operations are idempotent, they can get repeated without leading to different results. POST updates an existing resource or creates a new resource.

REST Web-services Example base URI for the web service:  http://example.com/resources/ Resource GET PUT POST DELETE Collection URI, such as http://example.com/resources/ List the URIs and perhaps other details of the collection's members. Replace the entire collection with another collection. Create a new entry in the collection. The new entry's URL is assigned automatically and is usually returned by the operation. Delete the entire collection. Element URI, such as http://example.com/resources/item17 Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. Replace the addressed member of the collection, or if it doesn't exist, create it. Not generally used. Treat the addressed member as a collection in its own right and create a new entry in it. Delete the addressed member of the collection.

JAX-RS JSR-311: “JAX-RS: The Java API for RESTful Web Services” Introduced in Java SE 5: annotation-based Objective: simplify the development and deployment of web service clients and endpoints. Part of J2EE 6 No configuration is necessary to start using JAX-RS

JAX-RS API Specifications Annotations to aid in mapping a resource class (a Plain Old Java Object) as a web resource. @Path specifies the relative path for a resource class or method. @GET, @PUT, @POST, @DELETE and @HEAD specify the HTTP request type of a resource. @Produces specifies the response MIME media types. @Consumes specifies the accepted request media types. Annotations to method parameters to pull information out of the request. All the @*Param annotations take a key of some form which is used to look up the value required. @PathParam binds the parameter to a path segment. @QueryParam binds the parameter to the value of an HTTP query parameter. @MatrixParam binds the parameter to the value of an HTTP matrix parameter. @HeaderParam binds the parameter to an HTTP header value. @CookieParam binds the parameter to a cookie value. @FormParam binds the parameter to a form value. @DefaultValue specifies a default value for the above bindings when the key is not found. @Context returns the entire context of the object. Ex.(@Context HttpServletRequest request)

JAX-RS API

JAX-RS implementations Apache, CFX from Apache Jersey, from Sun/Oracle (J2EE 6 reference implementation) RESTeasy, from Jboss Restlet, created by Jerome Louvel, a pioneer in REST frameworks. …

Practice http://jersey.java.net/ http://www.vogella.com/articles/REST/article.html http://docs.oracle.com/javaee/6/tutorial/doc/gilik.html

Keywords JAX-RS WSDL @QueryParam XML SOAP @POST @Path REST @GET stateless @PUT @DELETE