Click here to load reader
Upload
meriemsari
View
24
Download
0
Embed Size (px)
Citation preview
1
REST Web Service
By: Sari Meriem
UNIVERSITY of MOHAMED CHERIF MESAADIASOUK-AHRAS
Departement of Math & Computer Science
Presentation About:
Reminder
2Meriem Sari Service Web 2 eme AM GL
Stands for: Representational State Transfer.
Is an architectural style.
Introduced first in 2000 then standardized in 2008.
Everything in REST is considered as a resource.
Every resource is identified by an URI.
Reminder
3
Resources are handled using POST, GET, PUT, DELETE operations which are similar to Create, Read, update and Delete(CRUD) operations.
It uses uniform interfaces.
A RESTful Web service is a Web service implemented using HTTP and the principles of REST.
Meriem Sari Service Web 2 eme AM GL
Requirements
4
Eclipse luna.
jersey-archive-1.18.
Meriem Sari Service Web 2 eme AM GL
Example
5Meriem Sari Service Web 2 eme AM GL
Example
6
Copy all jar files from the Jersey zip into WEB-INF/lib folder.
Select build path in your project and add the same jars in your build path.
Create package called com.javatutorialscorner.rest.ws.
Create following class inside package com.javatutorialscorner.rest.ws
RestHelloWorld .java
Meriem Sari Service Web 2 eme AM GL
Example
7Meriem Sari Service Web 2 eme AM GL
Example
8
We get the following structure for our program
Meriem Sari Service Web 2 eme AM GL
Example
9
We configure the « web.xml » file to have the following code
Meriem Sari Service Web 2 eme AM GL
Example
10
We create the client class under the same package containing the following code:
Meriem Sari Service Web 2 eme AM GL
Example
11
We run our client side and we get the following results either in consol or in our web browser:
Meriem Sari Service Web 2 eme AM GL