SlideShare a Scribd company logo
1 of 34
Download to read offline
‫أكاديمية الحكومة اإللكترونية الفلسطينية‬
         The Palestinian eGovernment Academy
                       www.egovacademy.ps




                       Tutorial III:
Process Integration and Service Oriented Architectures


                Session 5
            REST Web Services

                      Prepared By

                 Mohammed Melhem


                          PalGov © 2011                        1
About

This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the
Commission of the European Communities, grant agreement 511159-TEMPUS-1-
2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps
Project Consortium:
             Birzeit University, Palestine
                                                           University of Trento, Italy
             (Coordinator )


             Palestine Polytechnic University, Palestine   Vrije Universiteit Brussel, Belgium


             Palestine Technical University, Palestine
                                                           Université de Savoie, France

             Ministry of Telecom and IT, Palestine
                                                           University of Namur, Belgium
             Ministry of Interior, Palestine
                                                           TrueTrust, UK
             Ministry of Local Government, Palestine


Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011
                                                                                                 2
© Copyright Notes
Everyone is encouraged to use this material, or part of it, but should properly
cite the project (logo and website), and the author of that part.


No part of this tutorial may be reproduced or modified in any form or by any
means, without prior written permission from the project, who have the full
copyrights on the material.




                   Attribution-NonCommercial-ShareAlike
                                CC-BY-NC-SA

This license lets others remix, tweak, and build upon your work non-
commercially, as long as they credit you and license their new creations
under the identical terms.

                                    PalGov © 2011                                 3
Tutorial Map



           Intended Learning Objectives
A: Knowledge and Understanding
                                                                                    Title                    T    Name
 3a1: Demonstrate knowledge of the fundamentals of middleware.
 3a2: Describe the concept behind web service protocols.
                                                                     Session0: Syllabus and overview         0   Aldasht
 3a3: Explain the concept of service oriented architecture.          Sesson1: Introduction to SOA            2   Aldasht
 3a4: Explain the concept of enterprise service bus.                 Session2: XML namespaces & XML schema   2   Aldasht
 3a5: Understanding WSDL service interfaces in UDDI.                 Session 3: Xpath & Xquery               4   Romi
B: Intellectual Skills                                               Session4: REST web services             3   M. Melhem
 3b1: Design, develop, and deploy applications based on Service      Session5: Lab2: Practice on REST        3   M. Melhem
 Oriented Architecture (SOA).                                        Session 6: SOAP                         2   Aldasht
 3b2: use Business Process Execution Language (BPEL).                Session 7: WSDL                         3   Aldasht
 3b3: using WSDL to describe web services.
                                                                     Session8: Lab 3: WSDL practice          3   Aldasht
C: Professional and Practical Skills                                 Session9: ESB                           4   Aldasht
 3c1: setup, Invoke, and deploy web services using integrated
                                                                     Session10: Lab4: Practice on ESB        4   Aldasht
 development environment.
                                                                     Session11: integration patterns         4   M. Melhem
 3c2: construct and use REST and SOAP messages for web
 services communication.                                             Session12: Lab5: integration patterns   4   M. Melhem
D: General and Transferable Skills                                   Session13: BPEL                         3   Aldasht
 d1: Working with team.                                              Session14: Lab6: Practice on BPEL       3   Aldasht
 d2: Presenting and defending ideas.                                 Session15: UDDI                         2   Aldasht
 d3: Use of creativity and innovation in problem solving.
 d4: Develop communication skills and logical reasoning abilities.
Session Outlines

1. What is REST?
2. Key Principles
3. Fundamental HTTP Concepts
4. Rest examples
5. Design guide lines
6. How to Document REST
7. Case Study
8. Common misuses
9. Code samples (C#, Java)
10. What we have else?
11. Conclusions
What is REST

• A service designed to embrace the “web” from the
  ground-up.
• Representational State Transfer
• An architecture style for designing networked application.
   – Introduced by Roy Fielding’s PhD Thesis (2000)
• The idea is that, provide a replacement for old and
  complex integration mechanisms RPC, COBRA, etc. using
  simple HTTP calls between systems.
   – The web itself, can be viewed as a REST-based architecture.
Key Principles

1.   Every element must have it’s ID.
2.   Things must be linked.
3.   Use standard methods
4.   Provide multiple representations
5.   Communicate statelessly
Every element must have it’s ID

• Relies on uniform interface URI’s
• Every thing is a resource (Data and Operations)
• Each resource has it a URI
   – Operations, process steps, etc.
   – Individual item
      • http://bzu.edu/course/123
      • http://ritaj.bzu.edu/faculty/1234
   – Collections
      • http://registration.bzu.edu/course/123/students
Things must be linked

• There is no connection state interaction is stateless,
  each request must carry all the information required to
  complete it, and must not rely on previous operations or
  requests.
• Two schools
   – The URL King (TUK)[3]
      • Encode all important staff in the URL
   – Hipermedia as the engine of application state (HARTEOAS) [2]
HARTEOAS

• Each URI maps to a single resource
• Each resource may have more than one URI i.e. versions.
• Details:
   – Client takes actions from the representations returned.
   – The media types used for the representations, and the links they
     may contain.
HATEOAS Example

Example Create record
• Request PUT /Phone HTTP1.1
             Host: http://example.com
             Content: application/xml
             <phone><person>Mohammed</person></phone>




• Response    201 Created
              Location: http//example.com/phones/mohammed
              Content: application/xml
              …
Provide multiple representations

• Rest is not a standard
   – There will never be a W3C recommendation.
   – Often server response is an XML, however other formats can also
     be used unlike other services i.e SOAP.
   – All data formats are acceptable such as JSON “JavaScript Object
     Notation”, however using human readable formats is not
     acceptable.
Communicate statelessly


  REST services are self contained and
  each request carries (transfer) all the
  information (state) that the server needs
  in order to complete it.
Example: Clients checkout
Client: I’m done, (identification) with a purchase
Server: OK, here it is your total for the items in http://example.com/users/
(identification) /basket
Fundamental HTTP Concepts

• Standard communication protocol for interacting with
  resources and other resources.
• HTTP defines:
   – A standard set of methods
   – Status codes
   – And headers for interaction with resources on the WEB
Standard methods

• Common set of methods to represent CRUD operations,
  based on HTTP standard verbs and response codes.
   Method     Description                              CRUD        SAFE   idempotent

   Get        Request a specific representation of a   Read
                                                                    YES      YES
              resource
   PUT        Create/Update a resource with provides   UPDATE/CR
                                                                    NO       YES
              representation                           EATE
   Delete     Delete the specified resource            DELETE
                                                                    NO       YES

   POST       Submits data to be processed by the      CREATE/UP
                                                                    NO        NO
              identified resource                      DATE
   OPTIONS/   Returns the methods supported by the     -
   HEAD       identified resource                                   YES      YES
Response Codes


Status Range        Description     Example
100 – 199           Informational   100 continue
200 – 299           Successful      200 OK
                                    201 Created
                                    202 Accepted
300 – 399           Redirection     301 Moved Permanently
                                    304 Not Modified
400 – 499           Client Error    400 Bad Request
                                    401 Client error
                                    404 Not found
500 – 599           Server Error    500 internal server error
                                    501 Not implemented
HTTP Headers

• Used to negotiate behavior between HTTP clients and
  server.
• Provide built in solutions for important communication
  concepts like:
   –   Redirection
   –   Content negotiation
   –   Security(Authentication, authorization)
   –   Caching
   –   Compression
Rest examples


Today most of the online solutions expose their Application
programmable interfaces (APIs) as a web services, these
services typically exposed as REST, and some of leading
companies provide a side WSDL services that easier to parse:

Examples of sites expose their services in REST Format:
    - Microsft.com
    - Filcker
    - Amazon.com
    - Facebook.com
Design guide lines

TIPS
• Use logical URL, don’t point to a physical paths.
• Don’t return bulks of data use pagination, and returned
  results should contain next and previous links.
• Make sure REST services are will documented, and don’t
  change its return type.
• Always include URI for additional actions “don’t let the
  client do it by himself/herself”
• GET request should not change state at anytime, use
  POST/DELETE/PUT for change operations.
How to Document REST

• WSDL and WADL
  – WSDL stands for Web Service Description Language, it is
    recommended standard by W3C to description SOAP services.
    WSDL is a flexible language, however it lack for HTTP verbs
    support, making it a poor choice for REST documentation.
     • WSDP 2.0 support HTTP verbs


  – WADL[4] the Web Application Description Language, an alternative
    for WSDL to document REST services, it is easy to understand and
    lighter compared to WSDL, however it lacks WSDL flexibility.
WADL example

<application xmlns="http://wadl.dev.java.net/2009/02"
  xmlns:app="http://www.w3.org/2007/app"
  xmlns:atom="http://www.w3.org/2005/Atom">

  <resources base="http://example.org/">
    <resource path="blog/main"
      type="http://www.w3.org/2007/app.wadl#entry_feed">
      <doc title="Main Site"/>
    </resource>
    <resource path="blog/pic"
      type="http://www.w3.org/2007/app.wadl#media_feed">
      <doc title="Pictures"/>
    </resource>
  </resources>
</application>
Case STUDY

Lets suppose you are in a university that provide an online services for their
students and faculty. One of your services provides supposed to provide following
services:
Operation                 Description
createStudent             Create a new student
getStudent                Retrieves student information for the authenticated
                          user
deleteStudent             Delete one student
updateStudent             Updates an existing student information
getStudentCourses         Retrieves student registered courses
registerStudentCourse     Register course for an existing student
getCourses                Retrieve all available courses
CASE STUDY

• Identify the resource the service will expose.
   – Student
   – Course
   – registered courses
CASE STUDY

• Analyze the functionality, to address type of resources:
   – An individual student profile
   – A collection of registered courses
   – A collection of courses
CASE STUDY

• Design the URI template
   – start with base urI i.e. http://birzeit.edu/
   – May use path component to disambiguate.
   – May use query string for further semantics
       /students/{studentid}
       /students/{studentid}/courses


• Identify status codes to utilized for operations
  i.e. 201 for new created student record
Design guide lines

• RESTfull interface

Method   URI Template                       RPC Equivalent
PUT      students/{studentdI}               createStudent
GET      students/{studentdI}               getStudent
PUT      students/{studentid}               updateStudent
DELETE   students/{studentid}               deleteStudent
GET      students/{studentid}/courses       getStudentCourses
PUT      student/{studentid}/courses/{id}   registerStudentCourse
Case Study [add a phone]


• Request     PUT /student/1095080/ HTTP 1.1
              Host: birzeit.edu
              <Student>
               <name>Karen</name>
               <nationalid>123456789</nationalid>
               <gender>female</gender>
              </ Student >

• Response    201 Created
              Location: http://birziet.edu/students/1095080
Common misuses

• Exposing implementation details
   – Expose database IDs and database entities
• Ignoring caching
   – It is powerful, increase performance and scalability.
• Ignoring return codes
   – There is more than 200 OK
• Ignoring mime-types
   – Using non-standard mimes
   – Not providing different representations
Code Demo [C#]

static string HttpGet(string url) {
   var req = WebRequest.Create(url) as HttpWebRequest;
   string result = null;
   using (var resp = req.GetResponse() as HttpWebResponse) {
       var reader = new
   StreamReader(resp.GetResponseStream());
       result = reader.ReadToEnd();
   }
   return result;
}
Code Demo [Java]

public static String httpGet(String urlStr) throws IOException {
   URL url = new URL(urlStr);
   HttpURLConnection conn = (HttpURLConnection)
   url.openConnection();
   if (conn.getResponseCode() != 200) {
        throw new IOException(conn.getResponseMessage());
   }
    // Buffer the result into a string
   BufferedReader rd = new BufferedReader( new
   InputStreamReader(conn.getInputStream()));
   StringBuilder sb = new StringBuilder();
   String line;
   while ((line = rd.readLine()) != null) {
        sb.append(line);
   }
   rd.close();
   conn.disconnect();
   return sb.toString();
}
What we have else?

• SOAP (Simple Object Access Protocol).
  That been introduced in session1, and will be covered in session 7 in more details.


• OData (Open Data Protocol)
  enables the creation of HTTP-based data services, which allow resources identified using
  Uniform Resource Identifiers (URIs) and defined in an abstract data model, to be published
  and edited by Web clients using simple HTTP messages. OData is intended to be used to
  expose and access information from a variety of sources including, but not limited to, relational
  databases, file systems, content management systems, and traditional Web sites.
Summary

•   REST is an Architecture style
•   Platform independent
•   Language independent
•   Standard based built on top (HTTP).
•   Data independent return any type of data, unlike SOAP
•   Next session will introduce the SOAP message
    construction for web services communication.
References

1.   Architectural Styles and the Design of Network-based Software Architectures, Roy
     Thomas Fielding, 2000
2.   http://en.wikipedia.org/wiki/HATEOAS
3.   Resource Oriented Architecture and REST, Assessment of impact and advantages on
     INSPIRE, Roberto Lucchi, Michel Millot, European Commission, Joint Research
     Centre, Institute for Environment and Sustainability, EUR 23397 EN - 2008
4.   http://en.wikipedia.org/wiki/Web_Application_Description_Language
5.   http://en.wikipedia.org/wiki/SOAP
6.   http://www.odata.org/developers/protocols/overview#RelationshipToOtherProtocols
Thanks
Mohammed Melhem

More Related Content

What's hot

Chapter 4 slides
Chapter 4 slidesChapter 4 slides
Chapter 4 slideslara_ays
 
Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Mustafa Jarrar
 
Mechanical Designing 6 Months
Mechanical Designing 6 MonthsMechanical Designing 6 Months
Mechanical Designing 6 MonthsPratima Parida
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corbaop205
 
Pal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddiPal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddiMustafa Jarrar
 

What's hot (7)

Chapter 4 slides
Chapter 4 slidesChapter 4 slides
Chapter 4 slides
 
Oracle
OracleOracle
Oracle
 
Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)
 
Java
JavaJava
Java
 
Mechanical Designing 6 Months
Mechanical Designing 6 MonthsMechanical Designing 6 Months
Mechanical Designing 6 Months
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corba
 
Pal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddiPal gov.tutorial3.session15.uddi
Pal gov.tutorial3.session15.uddi
 

Viewers also liked

Pal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaPal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaMustafa Jarrar
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Mustafa Jarrar
 
Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3Mustafa Jarrar
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Mustafa Jarrar
 
Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4Mustafa Jarrar
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Mustafa Jarrar
 
Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Mustafa Jarrar
 
Pal gov.tutorial1.session13 14
Pal gov.tutorial1.session13 14Pal gov.tutorial1.session13 14
Pal gov.tutorial1.session13 14Mustafa Jarrar
 
Business Process Modeling Notation Fundamentals
Business Process Modeling Notation FundamentalsBusiness Process Modeling Notation Fundamentals
Business Process Modeling Notation FundamentalsMustafa Jarrar
 

Viewers also liked (9)

Pal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaPal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schema
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6
 
Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3Pal gov.tutorial3.session8.lab3
Pal gov.tutorial3.session8.lab3
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5
 
Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4Pal gov.tutorial3.session10.lab4
Pal gov.tutorial3.session10.lab4
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2
 
Pal gov.tutorial3.session7
Pal gov.tutorial3.session7Pal gov.tutorial3.session7
Pal gov.tutorial3.session7
 
Pal gov.tutorial1.session13 14
Pal gov.tutorial1.session13 14Pal gov.tutorial1.session13 14
Pal gov.tutorial1.session13 14
 
Business Process Modeling Notation Fundamentals
Business Process Modeling Notation FundamentalsBusiness Process Modeling Notation Fundamentals
Business Process Modeling Notation Fundamentals
 

Similar to Pal gov.tutorial3.session4.rest

Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlineMustafa Jarrar
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol BuffersMatt O'Keefe
 
Pal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sPal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sMustafa Jarrar
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationMustafa Jarrar
 
E gov security_tut_session_6_lab
E gov security_tut_session_6_labE gov security_tut_session_6_lab
E gov security_tut_session_6_labMustafa Jarrar
 
Pal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasPal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasMustafa Jarrar
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014clairvoyantllc
 
Semantic web Document
Semantic web DocumentSemantic web Document
Semantic web Documentap
 
CANARIE Eduroam and Shibboleth Lessons & Areas of interest
CANARIE Eduroam and Shibboleth Lessons & Areas of interestCANARIE Eduroam and Shibboleth Lessons & Areas of interest
CANARIE Eduroam and Shibboleth Lessons & Areas of interestChris Phillips
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemasMustafa Jarrar
 
PowerPoint
PowerPointPowerPoint
PowerPointVideoguy
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesMustafa Jarrar
 
Pal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faPal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faMustafa Jarrar
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding ApacheconDaniel Parker
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataMustafa Jarrar
 
Linked services for the Web of Data
Linked services for the Web of DataLinked services for the Web of Data
Linked services for the Web of DataJohn Domingue
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsSteve Speicher
 
Web topic 1 internet
Web topic 1  internetWeb topic 1  internet
Web topic 1 internetCK Yang
 

Similar to Pal gov.tutorial3.session4.rest (20)

Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outline
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
 
Pal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sPal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd's
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integration
 
E gov security_tut_session_6_lab
E gov security_tut_session_6_labE gov security_tut_session_6_lab
E gov security_tut_session_6_lab
 
Pal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasPal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemas
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
 
Semantic web Document
Semantic web DocumentSemantic web Document
Semantic web Document
 
CANARIE Eduroam and Shibboleth Lessons & Areas of interest
CANARIE Eduroam and Shibboleth Lessons & Areas of interestCANARIE Eduroam and Shibboleth Lessons & Areas of interest
CANARIE Eduroam and Shibboleth Lessons & Areas of interest
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemas
 
PowerPoint
PowerPointPowerPoint
PowerPoint
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
 
Pal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faPal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_fa
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding Apachecon
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddata
 
Linked services for the Web of Data
Linked services for the Web of DataLinked services for the Web of Data
Linked services for the Web of Data
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
 
Web topic 1 internet
Web topic 1  internetWeb topic 1  internet
Web topic 1 internet
 
Future Internet
Future InternetFuture Internet
Future Internet
 

More from Mustafa Jarrar

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisMustafa Jarrar
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal OntologyMustafa Jarrar
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course OutlineMustafa Jarrar
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process ImplementationMustafa Jarrar
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineeringMustafa Jarrar
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsMustafa Jarrar
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs Mustafa Jarrar
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process ManagementMustafa Jarrar
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology Mustafa Jarrar
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesMustafa Jarrar
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORMMustafa Jarrar
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineMustafa Jarrar
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesMustafa Jarrar
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalMustafa Jarrar
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsMustafa Jarrar
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingMustafa Jarrar
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Mustafa Jarrar
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsMustafa Jarrar
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Mustafa Jarrar
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql ProjectMustafa Jarrar
 

More from Mustafa Jarrar (20)

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment Analysis
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal Ontology
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course Outline
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process Implementation
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineering
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical Constructs
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process Management
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion Rules
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORM
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in Palestine
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online Courses
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-final
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 Calls
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language Processing
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql Project
 

Recently uploaded

Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

Pal gov.tutorial3.session4.rest

  • 1. ‫أكاديمية الحكومة اإللكترونية الفلسطينية‬ The Palestinian eGovernment Academy www.egovacademy.ps Tutorial III: Process Integration and Service Oriented Architectures Session 5 REST Web Services Prepared By Mohammed Melhem PalGov © 2011 1
  • 2. About This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the Commission of the European Communities, grant agreement 511159-TEMPUS-1- 2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps Project Consortium: Birzeit University, Palestine University of Trento, Italy (Coordinator ) Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium Palestine Technical University, Palestine Université de Savoie, France Ministry of Telecom and IT, Palestine University of Namur, Belgium Ministry of Interior, Palestine TrueTrust, UK Ministry of Local Government, Palestine Coordinator: Dr. Mustafa Jarrar Birzeit University, P.O.Box 14- Birzeit, Palestine Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011 2
  • 3. © Copyright Notes Everyone is encouraged to use this material, or part of it, but should properly cite the project (logo and website), and the author of that part. No part of this tutorial may be reproduced or modified in any form or by any means, without prior written permission from the project, who have the full copyrights on the material. Attribution-NonCommercial-ShareAlike CC-BY-NC-SA This license lets others remix, tweak, and build upon your work non- commercially, as long as they credit you and license their new creations under the identical terms. PalGov © 2011 3
  • 4. Tutorial Map Intended Learning Objectives A: Knowledge and Understanding Title T Name 3a1: Demonstrate knowledge of the fundamentals of middleware. 3a2: Describe the concept behind web service protocols. Session0: Syllabus and overview 0 Aldasht 3a3: Explain the concept of service oriented architecture. Sesson1: Introduction to SOA 2 Aldasht 3a4: Explain the concept of enterprise service bus. Session2: XML namespaces & XML schema 2 Aldasht 3a5: Understanding WSDL service interfaces in UDDI. Session 3: Xpath & Xquery 4 Romi B: Intellectual Skills Session4: REST web services 3 M. Melhem 3b1: Design, develop, and deploy applications based on Service Session5: Lab2: Practice on REST 3 M. Melhem Oriented Architecture (SOA). Session 6: SOAP 2 Aldasht 3b2: use Business Process Execution Language (BPEL). Session 7: WSDL 3 Aldasht 3b3: using WSDL to describe web services. Session8: Lab 3: WSDL practice 3 Aldasht C: Professional and Practical Skills Session9: ESB 4 Aldasht 3c1: setup, Invoke, and deploy web services using integrated Session10: Lab4: Practice on ESB 4 Aldasht development environment. Session11: integration patterns 4 M. Melhem 3c2: construct and use REST and SOAP messages for web services communication. Session12: Lab5: integration patterns 4 M. Melhem D: General and Transferable Skills Session13: BPEL 3 Aldasht d1: Working with team. Session14: Lab6: Practice on BPEL 3 Aldasht d2: Presenting and defending ideas. Session15: UDDI 2 Aldasht d3: Use of creativity and innovation in problem solving. d4: Develop communication skills and logical reasoning abilities.
  • 5. Session Outlines 1. What is REST? 2. Key Principles 3. Fundamental HTTP Concepts 4. Rest examples 5. Design guide lines 6. How to Document REST 7. Case Study 8. Common misuses 9. Code samples (C#, Java) 10. What we have else? 11. Conclusions
  • 6. What is REST • A service designed to embrace the “web” from the ground-up. • Representational State Transfer • An architecture style for designing networked application. – Introduced by Roy Fielding’s PhD Thesis (2000) • The idea is that, provide a replacement for old and complex integration mechanisms RPC, COBRA, etc. using simple HTTP calls between systems. – The web itself, can be viewed as a REST-based architecture.
  • 7. Key Principles 1. Every element must have it’s ID. 2. Things must be linked. 3. Use standard methods 4. Provide multiple representations 5. Communicate statelessly
  • 8. Every element must have it’s ID • Relies on uniform interface URI’s • Every thing is a resource (Data and Operations) • Each resource has it a URI – Operations, process steps, etc. – Individual item • http://bzu.edu/course/123 • http://ritaj.bzu.edu/faculty/1234 – Collections • http://registration.bzu.edu/course/123/students
  • 9. Things must be linked • There is no connection state interaction is stateless, each request must carry all the information required to complete it, and must not rely on previous operations or requests. • Two schools – The URL King (TUK)[3] • Encode all important staff in the URL – Hipermedia as the engine of application state (HARTEOAS) [2]
  • 10. HARTEOAS • Each URI maps to a single resource • Each resource may have more than one URI i.e. versions. • Details: – Client takes actions from the representations returned. – The media types used for the representations, and the links they may contain.
  • 11. HATEOAS Example Example Create record • Request PUT /Phone HTTP1.1 Host: http://example.com Content: application/xml <phone><person>Mohammed</person></phone> • Response 201 Created Location: http//example.com/phones/mohammed Content: application/xml …
  • 12. Provide multiple representations • Rest is not a standard – There will never be a W3C recommendation. – Often server response is an XML, however other formats can also be used unlike other services i.e SOAP. – All data formats are acceptable such as JSON “JavaScript Object Notation”, however using human readable formats is not acceptable.
  • 13. Communicate statelessly REST services are self contained and each request carries (transfer) all the information (state) that the server needs in order to complete it. Example: Clients checkout Client: I’m done, (identification) with a purchase Server: OK, here it is your total for the items in http://example.com/users/ (identification) /basket
  • 14. Fundamental HTTP Concepts • Standard communication protocol for interacting with resources and other resources. • HTTP defines: – A standard set of methods – Status codes – And headers for interaction with resources on the WEB
  • 15. Standard methods • Common set of methods to represent CRUD operations, based on HTTP standard verbs and response codes. Method Description CRUD SAFE idempotent Get Request a specific representation of a Read YES YES resource PUT Create/Update a resource with provides UPDATE/CR NO YES representation EATE Delete Delete the specified resource DELETE NO YES POST Submits data to be processed by the CREATE/UP NO NO identified resource DATE OPTIONS/ Returns the methods supported by the - HEAD identified resource YES YES
  • 16. Response Codes Status Range Description Example 100 – 199 Informational 100 continue 200 – 299 Successful 200 OK 201 Created 202 Accepted 300 – 399 Redirection 301 Moved Permanently 304 Not Modified 400 – 499 Client Error 400 Bad Request 401 Client error 404 Not found 500 – 599 Server Error 500 internal server error 501 Not implemented
  • 17. HTTP Headers • Used to negotiate behavior between HTTP clients and server. • Provide built in solutions for important communication concepts like: – Redirection – Content negotiation – Security(Authentication, authorization) – Caching – Compression
  • 18. Rest examples Today most of the online solutions expose their Application programmable interfaces (APIs) as a web services, these services typically exposed as REST, and some of leading companies provide a side WSDL services that easier to parse: Examples of sites expose their services in REST Format: - Microsft.com - Filcker - Amazon.com - Facebook.com
  • 19. Design guide lines TIPS • Use logical URL, don’t point to a physical paths. • Don’t return bulks of data use pagination, and returned results should contain next and previous links. • Make sure REST services are will documented, and don’t change its return type. • Always include URI for additional actions “don’t let the client do it by himself/herself” • GET request should not change state at anytime, use POST/DELETE/PUT for change operations.
  • 20. How to Document REST • WSDL and WADL – WSDL stands for Web Service Description Language, it is recommended standard by W3C to description SOAP services. WSDL is a flexible language, however it lack for HTTP verbs support, making it a poor choice for REST documentation. • WSDP 2.0 support HTTP verbs – WADL[4] the Web Application Description Language, an alternative for WSDL to document REST services, it is easy to understand and lighter compared to WSDL, however it lacks WSDL flexibility.
  • 21. WADL example <application xmlns="http://wadl.dev.java.net/2009/02" xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom"> <resources base="http://example.org/"> <resource path="blog/main" type="http://www.w3.org/2007/app.wadl#entry_feed"> <doc title="Main Site"/> </resource> <resource path="blog/pic" type="http://www.w3.org/2007/app.wadl#media_feed"> <doc title="Pictures"/> </resource> </resources> </application>
  • 22. Case STUDY Lets suppose you are in a university that provide an online services for their students and faculty. One of your services provides supposed to provide following services: Operation Description createStudent Create a new student getStudent Retrieves student information for the authenticated user deleteStudent Delete one student updateStudent Updates an existing student information getStudentCourses Retrieves student registered courses registerStudentCourse Register course for an existing student getCourses Retrieve all available courses
  • 23. CASE STUDY • Identify the resource the service will expose. – Student – Course – registered courses
  • 24. CASE STUDY • Analyze the functionality, to address type of resources: – An individual student profile – A collection of registered courses – A collection of courses
  • 25. CASE STUDY • Design the URI template – start with base urI i.e. http://birzeit.edu/ – May use path component to disambiguate. – May use query string for further semantics /students/{studentid} /students/{studentid}/courses • Identify status codes to utilized for operations i.e. 201 for new created student record
  • 26. Design guide lines • RESTfull interface Method URI Template RPC Equivalent PUT students/{studentdI} createStudent GET students/{studentdI} getStudent PUT students/{studentid} updateStudent DELETE students/{studentid} deleteStudent GET students/{studentid}/courses getStudentCourses PUT student/{studentid}/courses/{id} registerStudentCourse
  • 27. Case Study [add a phone] • Request PUT /student/1095080/ HTTP 1.1 Host: birzeit.edu <Student> <name>Karen</name> <nationalid>123456789</nationalid> <gender>female</gender> </ Student > • Response 201 Created Location: http://birziet.edu/students/1095080
  • 28. Common misuses • Exposing implementation details – Expose database IDs and database entities • Ignoring caching – It is powerful, increase performance and scalability. • Ignoring return codes – There is more than 200 OK • Ignoring mime-types – Using non-standard mimes – Not providing different representations
  • 29. Code Demo [C#] static string HttpGet(string url) { var req = WebRequest.Create(url) as HttpWebRequest; string result = null; using (var resp = req.GetResponse() as HttpWebResponse) { var reader = new StreamReader(resp.GetResponseStream()); result = reader.ReadToEnd(); } return result; }
  • 30. Code Demo [Java] public static String httpGet(String urlStr) throws IOException { URL url = new URL(urlStr); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); if (conn.getResponseCode() != 200) { throw new IOException(conn.getResponseMessage()); } // Buffer the result into a string BufferedReader rd = new BufferedReader( new InputStreamReader(conn.getInputStream())); StringBuilder sb = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { sb.append(line); } rd.close(); conn.disconnect(); return sb.toString(); }
  • 31. What we have else? • SOAP (Simple Object Access Protocol). That been introduced in session1, and will be covered in session 7 in more details. • OData (Open Data Protocol) enables the creation of HTTP-based data services, which allow resources identified using Uniform Resource Identifiers (URIs) and defined in an abstract data model, to be published and edited by Web clients using simple HTTP messages. OData is intended to be used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems, and traditional Web sites.
  • 32. Summary • REST is an Architecture style • Platform independent • Language independent • Standard based built on top (HTTP). • Data independent return any type of data, unlike SOAP • Next session will introduce the SOAP message construction for web services communication.
  • 33. References 1. Architectural Styles and the Design of Network-based Software Architectures, Roy Thomas Fielding, 2000 2. http://en.wikipedia.org/wiki/HATEOAS 3. Resource Oriented Architecture and REST, Assessment of impact and advantages on INSPIRE, Roberto Lucchi, Michel Millot, European Commission, Joint Research Centre, Institute for Environment and Sustainability, EUR 23397 EN - 2008 4. http://en.wikipedia.org/wiki/Web_Application_Description_Language 5. http://en.wikipedia.org/wiki/SOAP 6. http://www.odata.org/developers/protocols/overview#RelationshipToOtherProtocols