SlideShare une entreprise Scribd logo
1  sur  63
Télécharger pour lire hors ligne
Web Services
Web Technology - 2ID60
26 November 2013
Katrien Verbert
Natasha Stash
George Fletcher
Plan for today
• 
• 
• 
• 
• 
• 

Recap: Web fundamentals
APIs, Web Services
Restful services
SOAP-based services
Comparison
Tutorial
•  JAX-WS: Building SOAP-based services in Java
•  JAX-RS: Building RESTful services in Java

PAGE 4
Recap: Web Fundamentals
Key Architectural Components
•  Identification: URI
•  Interaction: HTTP
•  Standardized Document Formats: HTML, XML, JSON, etc.

PAGE 5
URIs / resources
•  URIs identify interesting things
•  documents on the Web
•  relevant aspects of a data set

•  HTTP URIs name and address resources in
Web based systems
•  a URI names and identifies one resource
•  a resource can have more than one name
−  http://foo.com/software/latest
−  http://foo.com/software/v1.4

PAGE 6
Resource representation

PAGE 7
Plan for today
• 
• 
• 
• 
• 
• 

Recap: Web fundamentals
APIs, Web Services
RESTful services
SOAP-based services
Comparison
Tutorial
•  JAX-WS: Building SOAP-based services in Java
•  JAX-RS: Building RESTful services in Java

PAGE 8
APIs
What is an API?
and
Why do we need APIs?

PAGE 9
(Web) APIs
•  Application Programming Interface
•  Specifies how software components communicate
with each other
•  e.g., Java API, 3rd party library APIs
•  usually come with documentation

•  Web API: specify how applications communicate
with other over the Web (HTTP, URI, XML, etc.)

PAGE 10
Web Services, Web Applications and
APIs (Application Programming Interface)
•  Web Applications == Web Services == Web APIs ?

PAGE 11
Web Services, Web Applications and
APIs (Application Programming Interface)
•  Web Applications are designed to be accessed by
end users through Web client software
•  Web Services are intended to be used by other
software applications
•  Web APIs ≈ Web Services

PAGE 12
Web Services
•  “Web Services”

“Web APIs”

•  Build on the design principles and architectural
components of the Web
•  Provide certain operations
•  Exchange structured data in standard formats
(JSON, XML, etc.)

PAGE 13
Web Services

Example operations:
•  Publish image on Flickr
•  Order a book at Amazon
•  Post a message on your friend’s Facebook wall

PAGE 14
What Are Web Services?

PAGE 15
Example client application

http://ariadne.cs.kuleuven.be/alocom/alocom_plugin/alocom_plugin.swf
PAGE 16
PAGE 17
Disaggregation service

PAGE 18
What Are Web Services?
•  W3C definition:
•  A software system designed to support
interoperable machine-to-machine interaction over a
network...

PAGE 19
Web Services Use
•  Connect existing software
•  Reusable application components

PAGE 20
Major classes of Web Services
•  Big Web Services (L. Richardson and S. Ruby)
•  RESTful (REST-compliant) Web Services

PAGE 21
PAGE 22
PAGE 23
Overview
• 
• 
• 
• 
• 

Introduction
RESTful services
SOAP-based services
Comparison
Tutorial
•  JAX-WS: Building SOAP-based services in Java
•  JAX-RS: Building RESTful services in Java

PAGE 24
A RESTful Web service...
•  ... exposes its data and functionality through
interlinked Web resources identified by URI.
•  ... is more data-centric, and less functionality-centric
(as opposed to SOAP services).
•  ... embeds functionality of the service in the uniform
HTTP interfaces for interaction: GET, PUT, DELETE,
POST.
•  ... uses HTTP as the application protocol instead of
SOAP
PAGE 25
Four basic design principles
• 
• 
• 
• 

Use HTTP methods explicitly.
Be stateless.
Expose directory structure-like URIs.
Transfer XML, JavaScript Object Notation (JSON), or
both.

PAGE 26
Use HTTP methods explicitly
•  One-to-one mapping between
•  create, read, update, and delete (CRUD) operations
•  and HTTP methods.

•  According to this mapping:
• 
• 
• 
• 

To create a resource on the server, use POST.
To retrieve a resource, use GET.
To change the state of a resource or to update it, use PUT.
To remove or delete a resource, use DELETE.

PAGE 27
Example: HTTP GET request
GET /users/Robert HTTP/1.1
Host: myserver
Accept: application/xml

PAGE 28
Example: HTTP PUT request
PUT /users/Robert HTTP/1.1
Host: myserver
Content-Type: application/xml
<?xml version="1.0"?>
<user>
<name>Bob</name>
</user>

PAGE 29
Be stateless
Stateful design

Stateless design

PAGE 30
Expose directory structure-like URIs
http://www.myservice.org/discussion/topics/{topic}
http://www.myservice.org/discussion/{year}/{day}/{month}/{topic}
http://www.myservice.org/discussion/2008/12/10/{topic}

PAGE 31
Transfer XML, JSON, or both
<?xml version="1.0"?>
<discussion date="{date}" topic="{topic}">
<comment>{comment}</comment>
<replies>
<reply from="joe@mail.com" href="/discussion/topics/{topic}/joe"/>
<reply from="bob@mail.com" href="/discussion/topics/{topic}/bob"/>

</replies>
</discussion>

PAGE 32
Tools and frameworks
•  Ruby on Rails -- a framework for building RESTful Web
applications – http://www.rubyonrails.org/
•  Restlet -- framework for mapping REST concepts to Java
classes http://www.restlet.org
•  Django - framework for building RESTful Web applications in
Python
•  JAX-RC specification (http://jsr311.java.net/) -provides a Java
API for RESTful Web Services over the HTTP
•  RESTEasy (http://www.jboss.org/resteasy/) - Jboss project that
provides various frameworks for building RESTful Web
Services and RESTful Java applications.

PAGE 33
Overview
• 
• 
• 
• 
• 

Introduction
Restful services
Big web services
Comparison
Tutorial
•  JAX-WS: Building SOAP-based services in Java
•  JAX-RS: Building RESTful services in Java

PAGE 34
Big web services
•  SOAP (Simple Object Access Protocol)
•  WSDL (Web Services Description Language)
•  UDDI (Universal Description, Discovery, and
Integration)

PAGE 35
Roadmap
Service
Broker
(UDDI)

Find
(SOAP)

Service
Requester

Publish
(WSDL)

Bind
(SOAP)

Service
Provider

PAGE 36
What is SOAP
• 
• 
• 
• 
• 
• 
• 

SOAP used to stand for Simple Object Access Protocol
SOAP is a communication protocol
SOAP is designed to communicate via Internet
SOAP is based on XML
SOAP is simple and extensible
SOAP is platform and language independent
SOAP is a W3C standard

PAGE 37
SOAP Message Structure

SOAP Envelope
SOAP Header
header block
SOAP Body
body block

<?xml version='1.0' ?><env:Envelope
xmlns:env="
http://www.w3.org/2003/05/soap-envelope">
<env:Header>
...
</env:Header>
<env:Body>
...
<env:Fault>
...
</env:Fault>
</env:Body>
</env:Envelope>

PAGE 38
SOAP Example: RPC-Style Request Message
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<ts:getPrice xmlns:ts="http://travelagency.example.org/wsdl/trips"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding">
<ts:departing>Amsterdam (Schiphol)</ts:departing>
<ts:arriving>Saint-Petersburg (Pulkovo)</ts:arriving>
<ts:departureDate>01-05-2010</ts:departureDate>
<ts:/getPrice>
</env:Body>
</env:Envelope>

Request

<?xml version='1.0' ?><env:Envelope xmlns:env="
Response
http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<ts:getPriceResponse xmlns:ts="http://travelagency.example.org/wsdl/trips"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding" >
<ts:price>180.00</ts:price>
</ts:getPriceResponse>
</env:Body>
</env:Envelope>
PAGE 39
SOAP HTTP Binding:
SOAP HTTP Post Usage
POST /pricesService/getPrice HTTP/1.1
Host: http://travelagency.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<ts:getPrice xmlns:ts="http://travelagency.example.org/wsdl/trips">
<ts:departing>Amsterdam (Schiphol)</ts:departing>
<ts:arriving>Saint-Petersburg (Pulkovo)</ts:arriving>
<ts:departureDate>21-04-2010</ts:departureDate>
<ts:/getPrice>
</env:Body>
</env:Envelope>
PAGE 40
SOAP HTTP Binding:
SOAP Response
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<ts:getPriceResponse xmlns:ts="http://travelagency.example.org/wsdl/trips">
<ts:price>180.00</ts:price>
</ts:getPriceResponse>
</env:Body>
</env:Envelope>

PAGE 41
Roadmap
Service
Broker
(UDDI)

Find
(SOAP)

Service
Requester

Publish
(WSDL)

Bind
(SOAP)

Service
Provider

PAGE 42
What is WSDL
• 
• 
• 
• 

WSDL stands for Web Services Description Language
WSDL is used to describe and locate Web Services
WSDL is based on XML
WSDL is a W3C standard

PAGE 43
WSDL
•  Describes three fundamental properties
•  What a service does

• 

• 

How a service is accessed

• 

• 

Operations (methods) provided by the service
Data format and protocol details

Where a service is located

• 

Address (URL) details

PAGE 44
WSDL Document Structure
WSDL Specification
abstract part
types
messages
operations

Main structure of WSDL document
<definitions targerNamespace= ... >
<types>definition of types...</types>
<message>definition of a message...</message>

port types
<portType>definition of a port</portType>

concrete part
bindings
service
port

<binding>definition of a binding...</binding>
<service>
<port>...</port>
</service>
</definitions>

PAGE 45
WSDL Document Example:
Abstract Part
<message name="itineraryMsg">
<part name="departing" type="xs:string"/>
<part name="arriving" type="xs:string"/>
<part name="departureDate" type="xs:date"/>
</message>
<message name="itineraryRespMsg">
<part name="price" type="xs:string"/>
</message>
<portType name="pricesPT">
<operation name="getPrice">
<input message="itineraryMsg"/>
<output message="itineraryRespMsg"/>
</operation>
</portType>

PAGE 46
Operation Types
Type

Definition

One-way

The operation can receive a message but will not return
a response

Requestresponse

The operation can receive a request and will return a
response

Solicit-response The operation can send a request and will wait for a
response
Notification

The operation can send a message but will not wait for
a response

PAGE 47
Example: One-Way Operation
<message name="newPrices">
<part name="departing" type="xs:string"/>
<part name="arriving" type="xs:string"/>
<part name="departureDate" type="xs:date"/>
<part name="price" type="xs:string"/>
</message>
<portType name="pricesPT">
...
<operation name="setPrice">
<input message="newPrices"/>
</operation>
</portType >
PAGE 48
WSDL Document Example:
Concrete Part
<service name="pricesService">
<port name="getPriceRPCPort" binding="ts:b1">
<soap:address
location="http://travelagency.example.org/pricesService">
</port>
</service>
xmlns:ts='http://travelagency.example.org/wsdl/trips'

PAGE 49
Roadmap
Service
Broker
(UDDI)

Find
(SOAP)

Service
Requester

Publish
(WSDL)

Bind
(SOAP)

Service
Provider

PAGE 50
What is UDDI
•  UDDI stands for Universal Description, Discovery and Integration
•  UDDI a standard for publishing and discovering Web services
•  UDDI is a specification for a distributed registry of Web services
•  UDDI is built upon standards such as HTTP, XML, XML Schema,
SOAP, WSDL
•  UDDI can communicate via SOAP, CORBA, Java RMI Protocol
•  UDDI uses WSDL to describe interfaces to Web Services

PAGE 51
Ways to Use UDDI Registry
•  White pages
–  name, address, contact person, Web site

•  Yellow pages
–  types of business, locations, products, services,
categorizations

•  Green pages
–  technical information about business services, pointers
to WSDL descriptions of the services

PAGE 52
UDDI Data Model:
UDDI Core Data Types

Example: http://www.tutorialspoint.com/uddi/uddi_data_model.htm

PAGE 53
UDDI Data Model:
tModel example
<?xml version="1.0"?>
<tModel tModelKey="”>
<name>http://www.getquote.com/StockQuoteService-interface</name>
<description xml:lang="en">…</description>
<overviewDoc>
<description xml:lang="en”>WSDL Service Interface Document </description>
<overviewURL>
http://www.getquote.com/services/SQSinterface.wsdl#SingleSymbolBinding
</overviewURL>
</overviewDoc>
<categoryBag>
<keyedReference tModelKey="UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4”
keyName="uddi-org:types" keyValue="wsdlSpec"/>
<keyedReference tModelKey="UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384”
keyName="Stock market trading services”
keyValue="84121801"/>
</categoryBag>
</tModel>

PAGE 54
UDDI: Programmatic Interfaces
•  UDDI Inquiry Interface:
–  find_business, find_service, find_tModel, find_binding,
find_relatedBusiness
–  get_businessDetail, get_serviceDetail, get_bindingDetail,
get_tModelDetail

•  UDDI Publisher Interface:
–  save_business, save_service, save_binding,
save_tModel
–  delete_business, delete_service, delete_binding,
delete_tModel

–  ...!

PAGE 55
Big Web Services Examples
•  http://www.xmethods.com
•  http://www.programmableweb.com/

PAGE 56
Web services enable
1. 
2. 
3. 
4. 

data exchange between various applications and different platforms
to resolve interoperability issues
applications to function between two different operating systems server
all of the above

PAGE 57
Which of the following is used to locate
and describe web services?
1. 
2. 
3. 
4. 

SOAP
Web page
WSDL
UDDI

PAGE 58
Overview
• 
• 
• 
• 
• 

Introduction
Restful services
SOAP-based services
Comparison
Tutorial
•  JAX-WS: Building SOAP-based services in Java
•  JAX-RS: Building RESTful services in Java

PAGE 59
Big Web Service Operations vs
RESTful Web Service URIs
Big WS operations

RESTful WS URIs

getAllUsers()

http://example.com/users/
"

getUserById(String id)

http://example.com/users/id/{user-id}

getUserByName(…),
addUser(…)
removeUser(…),
updateUser(…)

http://example.com/users/name/{user-name}

PAGE 60
Big Web Services versus REST

•  A SOAP service has a single endpoint
•  that handles all the operations
•  therefore it has to have an application-specific
interface.

•  A RESTful service has a number of resources
•  so the operations can be distributed onto the resources
•  and mapped to a small uniform set of operations.

PAGE 61
Comparison:
Big Web Services vs RESTful Web Services
•  Big Web Services pros:
–  protocol transparency and independence
–  existence of tools to hide the complexity
–  security

•  Big Web Services cons:
– 
– 
– 
– 
– 

rudimentary processing protocol
complexity
heavyweight architecture
do not get the benefits of resource-oriented services
opaqueness

PAGE 62
Comparison:
Big Web Services vs RESTful Web Services
•  RESTful Web Services pros:
– 
– 
– 
– 
– 
– 

simplicity
lightweight infrastructure
addressability
uniform interface
scalability of stateless RESTful Web Service
improved performance using JSON

•  RESTful Web Services cons:
– 
– 
– 
– 

bound to one protocol: HTTP
only POST and GET can be used in XHTML form
dealing with large input data - malformed URI
security issues
PAGE 63
Sources
•  Cesare Pautasso,Olaf Zimmermann,Frank Leymann (2008)
RESTful Web Services vs. Big Web Services: Making the Right
Architectural Decision. Proc. of the 17th International World
Wide Web Conference (WWW2008), Bejing, China, April 2008.
•  Alex Rodriguez. (2008). RESTful Web services: The basics.
Available at:
http://www.ibm.com/developerworks/webservices/library/wsrestful/
•  Cesare Pautasso and Erik Wilde. Design Principles, Patterns
and Emerging Technologies for RESTful Web Services.
http://dret.net/netdret/docs/rest-icwe2010/
•  Bernhard Hasl. RESTful web service APIs
http://courses2.cit.cornell.edu/info4302_2012fa/lectures/week7/
INFO_CS4302_Lecture12.pdf

PAGE 64
k.verbert@tue.nl
n.v.stash@tue.nl
g.h.l.fletcher@tue.nl

PAGE 65

Contenu connexe

Tendances

Tendances (20)

Servlets
ServletsServlets
Servlets
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 
Serialization in .NET
Serialization in .NETSerialization in .NET
Serialization in .NET
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
Angular
AngularAngular
Angular
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
Next.js Introduction
Next.js IntroductionNext.js Introduction
Next.js Introduction
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Angular
AngularAngular
Angular
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
MVC in PHP
MVC in PHPMVC in PHP
MVC in PHP
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 

En vedette

EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...
EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...
EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...EquinoaDigitalAgency
 
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.Effinity
 
Emailing & Display : les mécaniques de ciblage (trafic et lead).
Emailing & Display : les mécaniques de ciblage (trafic et lead).Emailing & Display : les mécaniques de ciblage (trafic et lead).
Emailing & Display : les mécaniques de ciblage (trafic et lead).Jonathan Ravallec
 
Facebook, pour quel ROI ?
Facebook, pour quel ROI ?Facebook, pour quel ROI ?
Facebook, pour quel ROI ?polenumerique33
 
Acquisition de trafic : quels leviers utiliser
Acquisition de trafic : quels leviers utiliserAcquisition de trafic : quels leviers utiliser
Acquisition de trafic : quels leviers utiliserJonathan Ravallec
 

En vedette (8)

EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...
EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...
EQUINOA : Quels leviers mobiliser avec un budget limité ? - E-commerce Paris ...
 
Webservices
WebservicesWebservices
Webservices
 
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.
Webinar [B2B] Case study : Générer des leads B2B via Facebook efficacement.
 
Emailing & Display : les mécaniques de ciblage (trafic et lead).
Emailing & Display : les mécaniques de ciblage (trafic et lead).Emailing & Display : les mécaniques de ciblage (trafic et lead).
Emailing & Display : les mécaniques de ciblage (trafic et lead).
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Data modeling : Une obligation ?
Data modeling : Une obligation ?Data modeling : Une obligation ?
Data modeling : Une obligation ?
 
Facebook, pour quel ROI ?
Facebook, pour quel ROI ?Facebook, pour quel ROI ?
Facebook, pour quel ROI ?
 
Acquisition de trafic : quels leviers utiliser
Acquisition de trafic : quels leviers utiliserAcquisition de trafic : quels leviers utiliser
Acquisition de trafic : quels leviers utiliser
 

Similaire à Web Services

API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.Andrey Oleynik
 
Esri Web Applications February11 2011
Esri Web Applications February11 2011Esri Web Applications February11 2011
Esri Web Applications February11 2011delmelle
 
Web Landscape - updated in Jan 2016
Web Landscape - updated in Jan 2016Web Landscape - updated in Jan 2016
Web Landscape - updated in Jan 2016Jack Zheng
 
Prototyping interactions
Prototyping interactionsPrototyping interactions
Prototyping interactionsselwynjacob90
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIsanandology
 
APIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be usedAPIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be usedsnackeru
 
Using the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur TomusiakUsing the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur Tomusiakhannonhill
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)Alexander Goida
 
Java-Web-Applications.pdf
Java-Web-Applications.pdfJava-Web-Applications.pdf
Java-Web-Applications.pdfssuserf2dc4c1
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar SlidesDuraSpace
 

Similaire à Web Services (20)

Ntg web services
Ntg   web servicesNtg   web services
Ntg web services
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Esri Web Applications February11 2011
Esri Web Applications February11 2011Esri Web Applications February11 2011
Esri Web Applications February11 2011
 
Web Landscape - updated in Jan 2016
Web Landscape - updated in Jan 2016Web Landscape - updated in Jan 2016
Web Landscape - updated in Jan 2016
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Linked services
Linked servicesLinked services
Linked services
 
Prototyping interactions
Prototyping interactionsPrototyping interactions
Prototyping interactions
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIs
 
APIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be usedAPIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be used
 
Using the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur TomusiakUsing the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur Tomusiak
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)
 
Java-Web-Applications.pdf
Java-Web-Applications.pdfJava-Web-Applications.pdf
Java-Web-Applications.pdf
 
Sinatra
SinatraSinatra
Sinatra
 
Ws rest
Ws restWs rest
Ws rest
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides
 

Plus de Katrien Verbert

Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Katrien Verbert
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Katrien Verbert
 
Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Katrien Verbert
 
Explaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveExplaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveKatrien Verbert
 
Explaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedExplaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedKatrien Verbert
 
Designing Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedDesigning Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedKatrien Verbert
 
Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Katrien Verbert
 
Explainable AI for non-expert users
Explainable AI for non-expert usersExplainable AI for non-expert users
Explainable AI for non-expert usersKatrien Verbert
 
Towards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsTowards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsKatrien Verbert
 
Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Katrien Verbert
 
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Katrien Verbert
 
Learning analytics for feedback at scale
Learning analytics for feedback at scaleLearning analytics for feedback at scale
Learning analytics for feedback at scaleKatrien Verbert
 
Interactive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningInteractive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningKatrien Verbert
 
Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Katrien Verbert
 
Interactive Recommender Systems
Interactive Recommender SystemsInteractive Recommender Systems
Interactive Recommender SystemsKatrien Verbert
 
Web Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLWeb Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLKatrien Verbert
 
Information Visualisation: perception and principles
Information Visualisation: perception and principlesInformation Visualisation: perception and principles
Information Visualisation: perception and principlesKatrien Verbert
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionKatrien Verbert
 
Information Visualisation: Introduction
Information Visualisation: IntroductionInformation Visualisation: Introduction
Information Visualisation: IntroductionKatrien Verbert
 

Plus de Katrien Verbert (20)

Explainability methods
Explainability methodsExplainability methods
Explainability methods
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?
 
Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?
 
Explaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveExplaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspective
 
Explaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedExplaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learned
 
Designing Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedDesigning Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons Learned
 
Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...
 
Explainable AI for non-expert users
Explainable AI for non-expert usersExplainable AI for non-expert users
Explainable AI for non-expert users
 
Towards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsTowards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methods
 
Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...
 
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
 
Learning analytics for feedback at scale
Learning analytics for feedback at scaleLearning analytics for feedback at scale
Learning analytics for feedback at scale
 
Interactive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningInteractive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learning
 
Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”
 
Interactive Recommender Systems
Interactive Recommender SystemsInteractive Recommender Systems
Interactive Recommender Systems
 
Web Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLWeb Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTML
 
Information Visualisation: perception and principles
Information Visualisation: perception and principlesInformation Visualisation: perception and principles
Information Visualisation: perception and principles
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: Introduction
 
Information Visualisation: Introduction
Information Visualisation: IntroductionInformation Visualisation: Introduction
Information Visualisation: Introduction
 

Dernier

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 

Dernier (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 

Web Services

  • 1. Web Services Web Technology - 2ID60 26 November 2013 Katrien Verbert Natasha Stash George Fletcher
  • 2. Plan for today •  •  •  •  •  •  Recap: Web fundamentals APIs, Web Services Restful services SOAP-based services Comparison Tutorial •  JAX-WS: Building SOAP-based services in Java •  JAX-RS: Building RESTful services in Java PAGE 4
  • 3. Recap: Web Fundamentals Key Architectural Components •  Identification: URI •  Interaction: HTTP •  Standardized Document Formats: HTML, XML, JSON, etc. PAGE 5
  • 4. URIs / resources •  URIs identify interesting things •  documents on the Web •  relevant aspects of a data set •  HTTP URIs name and address resources in Web based systems •  a URI names and identifies one resource •  a resource can have more than one name −  http://foo.com/software/latest −  http://foo.com/software/v1.4 PAGE 6
  • 6. Plan for today •  •  •  •  •  •  Recap: Web fundamentals APIs, Web Services RESTful services SOAP-based services Comparison Tutorial •  JAX-WS: Building SOAP-based services in Java •  JAX-RS: Building RESTful services in Java PAGE 8
  • 7. APIs What is an API? and Why do we need APIs? PAGE 9
  • 8. (Web) APIs •  Application Programming Interface •  Specifies how software components communicate with each other •  e.g., Java API, 3rd party library APIs •  usually come with documentation •  Web API: specify how applications communicate with other over the Web (HTTP, URI, XML, etc.) PAGE 10
  • 9. Web Services, Web Applications and APIs (Application Programming Interface) •  Web Applications == Web Services == Web APIs ? PAGE 11
  • 10. Web Services, Web Applications and APIs (Application Programming Interface) •  Web Applications are designed to be accessed by end users through Web client software •  Web Services are intended to be used by other software applications •  Web APIs ≈ Web Services PAGE 12
  • 11. Web Services •  “Web Services” “Web APIs” •  Build on the design principles and architectural components of the Web •  Provide certain operations •  Exchange structured data in standard formats (JSON, XML, etc.) PAGE 13
  • 12. Web Services Example operations: •  Publish image on Flickr •  Order a book at Amazon •  Post a message on your friend’s Facebook wall PAGE 14
  • 13. What Are Web Services? PAGE 15
  • 17. What Are Web Services? •  W3C definition: •  A software system designed to support interoperable machine-to-machine interaction over a network... PAGE 19
  • 18. Web Services Use •  Connect existing software •  Reusable application components PAGE 20
  • 19. Major classes of Web Services •  Big Web Services (L. Richardson and S. Ruby) •  RESTful (REST-compliant) Web Services PAGE 21
  • 22. Overview •  •  •  •  •  Introduction RESTful services SOAP-based services Comparison Tutorial •  JAX-WS: Building SOAP-based services in Java •  JAX-RS: Building RESTful services in Java PAGE 24
  • 23. A RESTful Web service... •  ... exposes its data and functionality through interlinked Web resources identified by URI. •  ... is more data-centric, and less functionality-centric (as opposed to SOAP services). •  ... embeds functionality of the service in the uniform HTTP interfaces for interaction: GET, PUT, DELETE, POST. •  ... uses HTTP as the application protocol instead of SOAP PAGE 25
  • 24. Four basic design principles •  •  •  •  Use HTTP methods explicitly. Be stateless. Expose directory structure-like URIs. Transfer XML, JavaScript Object Notation (JSON), or both. PAGE 26
  • 25. Use HTTP methods explicitly •  One-to-one mapping between •  create, read, update, and delete (CRUD) operations •  and HTTP methods. •  According to this mapping: •  •  •  •  To create a resource on the server, use POST. To retrieve a resource, use GET. To change the state of a resource or to update it, use PUT. To remove or delete a resource, use DELETE. PAGE 27
  • 26. Example: HTTP GET request GET /users/Robert HTTP/1.1 Host: myserver Accept: application/xml PAGE 28
  • 27. Example: HTTP PUT request PUT /users/Robert HTTP/1.1 Host: myserver Content-Type: application/xml <?xml version="1.0"?> <user> <name>Bob</name> </user> PAGE 29
  • 29. Expose directory structure-like URIs http://www.myservice.org/discussion/topics/{topic} http://www.myservice.org/discussion/{year}/{day}/{month}/{topic} http://www.myservice.org/discussion/2008/12/10/{topic} PAGE 31
  • 30. Transfer XML, JSON, or both <?xml version="1.0"?> <discussion date="{date}" topic="{topic}"> <comment>{comment}</comment> <replies> <reply from="joe@mail.com" href="/discussion/topics/{topic}/joe"/> <reply from="bob@mail.com" href="/discussion/topics/{topic}/bob"/> </replies> </discussion> PAGE 32
  • 31. Tools and frameworks •  Ruby on Rails -- a framework for building RESTful Web applications – http://www.rubyonrails.org/ •  Restlet -- framework for mapping REST concepts to Java classes http://www.restlet.org •  Django - framework for building RESTful Web applications in Python •  JAX-RC specification (http://jsr311.java.net/) -provides a Java API for RESTful Web Services over the HTTP •  RESTEasy (http://www.jboss.org/resteasy/) - Jboss project that provides various frameworks for building RESTful Web Services and RESTful Java applications. PAGE 33
  • 32. Overview •  •  •  •  •  Introduction Restful services Big web services Comparison Tutorial •  JAX-WS: Building SOAP-based services in Java •  JAX-RS: Building RESTful services in Java PAGE 34
  • 33. Big web services •  SOAP (Simple Object Access Protocol) •  WSDL (Web Services Description Language) •  UDDI (Universal Description, Discovery, and Integration) PAGE 35
  • 35. What is SOAP •  •  •  •  •  •  •  SOAP used to stand for Simple Object Access Protocol SOAP is a communication protocol SOAP is designed to communicate via Internet SOAP is based on XML SOAP is simple and extensible SOAP is platform and language independent SOAP is a W3C standard PAGE 37
  • 36. SOAP Message Structure SOAP Envelope SOAP Header header block SOAP Body body block <?xml version='1.0' ?><env:Envelope xmlns:env=" http://www.w3.org/2003/05/soap-envelope"> <env:Header> ... </env:Header> <env:Body> ... <env:Fault> ... </env:Fault> </env:Body> </env:Envelope> PAGE 38
  • 37. SOAP Example: RPC-Style Request Message <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Body> <ts:getPrice xmlns:ts="http://travelagency.example.org/wsdl/trips" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding"> <ts:departing>Amsterdam (Schiphol)</ts:departing> <ts:arriving>Saint-Petersburg (Pulkovo)</ts:arriving> <ts:departureDate>01-05-2010</ts:departureDate> <ts:/getPrice> </env:Body> </env:Envelope> Request <?xml version='1.0' ?><env:Envelope xmlns:env=" Response http://www.w3.org/2003/05/soap-envelope"> <env:Body> <ts:getPriceResponse xmlns:ts="http://travelagency.example.org/wsdl/trips" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding" > <ts:price>180.00</ts:price> </ts:getPriceResponse> </env:Body> </env:Envelope> PAGE 39
  • 38. SOAP HTTP Binding: SOAP HTTP Post Usage POST /pricesService/getPrice HTTP/1.1 Host: http://travelagency.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Body> <ts:getPrice xmlns:ts="http://travelagency.example.org/wsdl/trips"> <ts:departing>Amsterdam (Schiphol)</ts:departing> <ts:arriving>Saint-Petersburg (Pulkovo)</ts:arriving> <ts:departureDate>21-04-2010</ts:departureDate> <ts:/getPrice> </env:Body> </env:Envelope> PAGE 40
  • 39. SOAP HTTP Binding: SOAP Response HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Body> <ts:getPriceResponse xmlns:ts="http://travelagency.example.org/wsdl/trips"> <ts:price>180.00</ts:price> </ts:getPriceResponse> </env:Body> </env:Envelope> PAGE 41
  • 41. What is WSDL •  •  •  •  WSDL stands for Web Services Description Language WSDL is used to describe and locate Web Services WSDL is based on XML WSDL is a W3C standard PAGE 43
  • 42. WSDL •  Describes three fundamental properties •  What a service does •  •  How a service is accessed •  •  Operations (methods) provided by the service Data format and protocol details Where a service is located •  Address (URL) details PAGE 44
  • 43. WSDL Document Structure WSDL Specification abstract part types messages operations Main structure of WSDL document <definitions targerNamespace= ... > <types>definition of types...</types> <message>definition of a message...</message> port types <portType>definition of a port</portType> concrete part bindings service port <binding>definition of a binding...</binding> <service> <port>...</port> </service> </definitions> PAGE 45
  • 44. WSDL Document Example: Abstract Part <message name="itineraryMsg"> <part name="departing" type="xs:string"/> <part name="arriving" type="xs:string"/> <part name="departureDate" type="xs:date"/> </message> <message name="itineraryRespMsg"> <part name="price" type="xs:string"/> </message> <portType name="pricesPT"> <operation name="getPrice"> <input message="itineraryMsg"/> <output message="itineraryRespMsg"/> </operation> </portType> PAGE 46
  • 45. Operation Types Type Definition One-way The operation can receive a message but will not return a response Requestresponse The operation can receive a request and will return a response Solicit-response The operation can send a request and will wait for a response Notification The operation can send a message but will not wait for a response PAGE 47
  • 46. Example: One-Way Operation <message name="newPrices"> <part name="departing" type="xs:string"/> <part name="arriving" type="xs:string"/> <part name="departureDate" type="xs:date"/> <part name="price" type="xs:string"/> </message> <portType name="pricesPT"> ... <operation name="setPrice"> <input message="newPrices"/> </operation> </portType > PAGE 48
  • 47. WSDL Document Example: Concrete Part <service name="pricesService"> <port name="getPriceRPCPort" binding="ts:b1"> <soap:address location="http://travelagency.example.org/pricesService"> </port> </service> xmlns:ts='http://travelagency.example.org/wsdl/trips' PAGE 49
  • 49. What is UDDI •  UDDI stands for Universal Description, Discovery and Integration •  UDDI a standard for publishing and discovering Web services •  UDDI is a specification for a distributed registry of Web services •  UDDI is built upon standards such as HTTP, XML, XML Schema, SOAP, WSDL •  UDDI can communicate via SOAP, CORBA, Java RMI Protocol •  UDDI uses WSDL to describe interfaces to Web Services PAGE 51
  • 50. Ways to Use UDDI Registry •  White pages –  name, address, contact person, Web site •  Yellow pages –  types of business, locations, products, services, categorizations •  Green pages –  technical information about business services, pointers to WSDL descriptions of the services PAGE 52
  • 51. UDDI Data Model: UDDI Core Data Types Example: http://www.tutorialspoint.com/uddi/uddi_data_model.htm PAGE 53
  • 52. UDDI Data Model: tModel example <?xml version="1.0"?> <tModel tModelKey="”> <name>http://www.getquote.com/StockQuoteService-interface</name> <description xml:lang="en">…</description> <overviewDoc> <description xml:lang="en”>WSDL Service Interface Document </description> <overviewURL> http://www.getquote.com/services/SQSinterface.wsdl#SingleSymbolBinding </overviewURL> </overviewDoc> <categoryBag> <keyedReference tModelKey="UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4” keyName="uddi-org:types" keyValue="wsdlSpec"/> <keyedReference tModelKey="UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384” keyName="Stock market trading services” keyValue="84121801"/> </categoryBag> </tModel> PAGE 54
  • 53. UDDI: Programmatic Interfaces •  UDDI Inquiry Interface: –  find_business, find_service, find_tModel, find_binding, find_relatedBusiness –  get_businessDetail, get_serviceDetail, get_bindingDetail, get_tModelDetail •  UDDI Publisher Interface: –  save_business, save_service, save_binding, save_tModel –  delete_business, delete_service, delete_binding, delete_tModel –  ...! PAGE 55
  • 54. Big Web Services Examples •  http://www.xmethods.com •  http://www.programmableweb.com/ PAGE 56
  • 55. Web services enable 1.  2.  3.  4.  data exchange between various applications and different platforms to resolve interoperability issues applications to function between two different operating systems server all of the above PAGE 57
  • 56. Which of the following is used to locate and describe web services? 1.  2.  3.  4.  SOAP Web page WSDL UDDI PAGE 58
  • 57. Overview •  •  •  •  •  Introduction Restful services SOAP-based services Comparison Tutorial •  JAX-WS: Building SOAP-based services in Java •  JAX-RS: Building RESTful services in Java PAGE 59
  • 58. Big Web Service Operations vs RESTful Web Service URIs Big WS operations RESTful WS URIs getAllUsers() http://example.com/users/ " getUserById(String id) http://example.com/users/id/{user-id} getUserByName(…), addUser(…) removeUser(…), updateUser(…) http://example.com/users/name/{user-name} PAGE 60
  • 59. Big Web Services versus REST •  A SOAP service has a single endpoint •  that handles all the operations •  therefore it has to have an application-specific interface. •  A RESTful service has a number of resources •  so the operations can be distributed onto the resources •  and mapped to a small uniform set of operations. PAGE 61
  • 60. Comparison: Big Web Services vs RESTful Web Services •  Big Web Services pros: –  protocol transparency and independence –  existence of tools to hide the complexity –  security •  Big Web Services cons: –  –  –  –  –  rudimentary processing protocol complexity heavyweight architecture do not get the benefits of resource-oriented services opaqueness PAGE 62
  • 61. Comparison: Big Web Services vs RESTful Web Services •  RESTful Web Services pros: –  –  –  –  –  –  simplicity lightweight infrastructure addressability uniform interface scalability of stateless RESTful Web Service improved performance using JSON •  RESTful Web Services cons: –  –  –  –  bound to one protocol: HTTP only POST and GET can be used in XHTML form dealing with large input data - malformed URI security issues PAGE 63
  • 62. Sources •  Cesare Pautasso,Olaf Zimmermann,Frank Leymann (2008) RESTful Web Services vs. Big Web Services: Making the Right Architectural Decision. Proc. of the 17th International World Wide Web Conference (WWW2008), Bejing, China, April 2008. •  Alex Rodriguez. (2008). RESTful Web services: The basics. Available at: http://www.ibm.com/developerworks/webservices/library/wsrestful/ •  Cesare Pautasso and Erik Wilde. Design Principles, Patterns and Emerging Technologies for RESTful Web Services. http://dret.net/netdret/docs/rest-icwe2010/ •  Bernhard Hasl. RESTful web service APIs http://courses2.cit.cornell.edu/info4302_2012fa/lectures/week7/ INFO_CS4302_Lecture12.pdf PAGE 64