Overview of RESTful Web Services and Service-Oriented Architecture

undefined
 
RESTful Web Services
 
COMP3220 Web Infrastructure
 
Dr Nicholas Gibbins
 
Service-Oriented Architecture
 
Term used to describe a style of software design
Systems comprise a number of distributed components
Components interact over a network
Components provide discrete functionalities with well-defined interfaces: services
Loose coupling of components
 
Popular from the early 90s
DCOM, CORBA, etc
 
Widespread adoption of the Web gave SOA a new lease of life as Web Services
Web Services
 
“Traditional” Web Services based on W3C
Web Services Architecture (+WS-I, etc)
SOAP for invoking services
WSDL for describing services
UDDI for publishing and locating services
 
Didn't fit with the Web Architecture
HTTP used for message transport only
(and everything sent as a POST)
URIs identify endpoints, not resources
service
provider
service
requester
wsdl
 
Overcomplication is not a virtue
 
Resource-Oriented Architecture
 
Software architecture building on REST and the Web architecture
 
Components = resources
 
Key REST constraints
Client-server
Stateless
Uniform interface
Richardson, L. and Ruby, S. (2007) 
RESTful Web Services
. Sebastopol, CA: O'Reilly.
 
The Richardson Maturity Model
 
Model of RESTful maturity
 
REST constraints made concrete, in
context of Web architecture components
Identification = URI
Interaction = HTTP
Representation = Hypermedia
Webber, J. et al (2010) 
REST in Practice
. Sebastopol, CA: O'Reilly
 
Level Zero
 
Service has a single well-known endpoint
URI identifies endpoint, not service
Uses HTTP as a transport only
No hypermedia to express state/protocol
 
Examples:
XML-RPC
Most SOAP services
POX – Plain Old XML over HTTP
 
POX: Plain Old XML over HTTP
 
9
 
Use HTTP POST to transfer XML documents between systems
SOAP-like, without SOAP headers, etc
Platform independent
Uses HTTP as a 
transport protocol
, not an 
application protocol
HTTP metadata is ignored
 
Level One
 
Multiple endpoints
URIs identify different operations,
possibly different resources
Uses HTTP as a transport only
(single verb, usually GET or POST)
No hypermedia to express state/protocol
 
Templates and Tunnelling
 
11
 
URI templates
http://restbucks.com/order/{order_id}
URI tunneling
Use GET for safe/idempotent operations
Use POST otherwise
Map existing method parameters to URI query parameters
http://restbucks.com/PlaceOrder?
coffee=latte&size=large
 
URI Tunnelling
 
12
 
Sometimes
 Web-friendly
Multiple URIs used to name resources
(Sometimes) correct use of GET
but
URIs often used to encode operations, rather than identify resources
Use of GET for non-safe operations breaches Web Architecture principle of Safe Retrieval
 
Level Two
 
Multiple endpoints, identifying resources
Understands HTTP (multiple verbs)
No hypermedia to express state/protocol
 
Mapping CRUD to HTTP
 
14
 
Level Three
 
Multiple endpoints, identifying resources
Understands HTTP (multiple verbs)
Uses hypermedia to communicate
protocols (shared state)
 
HATEOAS
 
16
 
Hypermedia As The Engine Of Application State
Resource representations include links to related resources
Links that represent a transition to a possible future state of the current resource
Link types 
used to indicate operations (HTTP verbs?) that may be used on the indicated
resources
State transitions constitute application protocol
 
Further Reading
 
Richardson, L. and Ruby, S. (2007) 
RESTful Web Services
. Sebastopol, CA: O'Reilly.
 
Webber, J. et al (2010) 
REST in Practice
. Sebastopol, CA: O'Reilly
 
Webber, J. et al (2009) 
REST in Practice: A Tutorial on Web-based services
https://www.slideshare.net/guilhermecaelum/rest-in-practice
 
 
Next Lecture: REST in Practice
Slide Note
Embed
Share

This content provides insights into RESTful Web Services, Service-Oriented Architecture (SOA), Traditional Web Services, Overcomplication in system design, and Resource-Oriented Architecture. It discusses key concepts, technologies, and standards involved in these architectures, along with details on the Richardson Maturity Model for REST. It emphasizes the importance of building software systems with a focus on web standards and REST principles.

  • RESTful Web Services
  • Service-Oriented Architecture
  • SOA
  • Web Services
  • Richardson Maturity Model

Uploaded on Jul 19, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. RESTful Web Services COMP3220 Web Infrastructure Dr Nicholas Gibbins

  2. Service-Oriented Architecture Term used to describe a style of software design Systems comprise a number of distributed components Components interact over a network Components provide discrete functionalities with well-defined interfaces: services Loose coupling of components Popular from the early 90s DCOM, CORBA, etc Widespread adoption of the Web gave SOA a new lease of life as Web Services 3

  3. Web Services Traditional Web Services based on W3C Web Services Architecture (+WS-I, etc) SOAP for invoking services WSDL for describing services UDDI for publishing and locating services service broker UDDI UDDI wsdl wsdl Didn't fit with the Web Architecture HTTP used for message transport only (and everything sent as a POST) URIs identify endpoints, not resources SOAP service provider service requester 4

  4. Overcomplication is not a virtue Layer Transport Messaging Description Discovery Choreography Business Processes Stateful resources Transactions Reliable Messaging Security Event Notification Management Data Access Technologies and Standards HTTP, IIOP, SMTP, JMS XML, SOAP, WS-Addressing XML Schema, WSDL, WS-Policy, SSDL UDDI, WS-MetadataExchange WS-CL, WS-CI, WS-Coordination WS-BPEL, BPML, WS-CDL WS-ResourceFramework WS-CAF, WS-AtomicTransactions, WS-BusinessActivities WS-Reliability, WS-ReliableMessaging WS-Security, SAML, XACML, WS-Trust, WS-Privacy, WS-SecureConversation WS-Notification, WS-Eventing WS-DM, WS-Management OGSA-DAI, SDO 5

  5. Resource-Oriented Architecture Software architecture building on REST and the Web architecture Components = resources Key REST constraints Client-server Stateless Uniform interface Richardson, L. and Ruby, S. (2007) RESTful Web Services. Sebastopol, CA: O'Reilly. 6

  6. The Richardson Maturity Model Model of RESTful maturity Hypermedia REST constraints made concrete, in context of Web architecture components Identification = URI Interaction = HTTP Representation = Hypermedia HTTP URI Webber, J. et al (2010) REST in Practice. Sebastopol, CA: O'Reilly 7

  7. Level Zero Service has a single well-known endpoint URI identifies endpoint, not service Uses HTTP as a transport only No hypermedia to express state/protocol Hypermedia HTTP Examples: XML-RPC Most SOAP services POX Plain Old XML over HTTP URI 8

  8. POX: Plain Old XML over HTTP Use HTTP POST to transfer XML documents between systems SOAP-like, without SOAP headers, etc Platform independent Uses HTTP as a transport protocol, not an application protocol HTTP metadata is ignored 9 9

  9. Level One Multiple endpoints URIs identify different operations, possibly different resources Uses HTTP as a transport only (single verb, usually GET or POST) No hypermedia to express state/protocol Hypermedia HTTP URI 10

  10. Templates and Tunnelling URI templates http://restbucks.com/order/{order_id} URI tunneling Use GET for safe/idempotent operations Use POST otherwise Map existing method parameters to URI query parameters http://restbucks.com/PlaceOrder?coffee coffee= =latte&size latte&size=large =large 11 11

  11. URI Tunnelling Sometimes Web-friendly Multiple URIs used to name resources (Sometimes) correct use of GET but URIs often used to encode operations, rather than identify resources Use of GET for non-safe operations breaches Web Architecture principle of Safe Retrieval 12 12

  12. Level Two Multiple endpoints, identifying resources Understands HTTP (multiple verbs) No hypermedia to express state/protocol Hypermedia HTTP URI 13

  13. Mapping CRUD to HTTP Operation HTTP Verb Create POST to a URI, creates new subordinate resource Read GET, returns representation Update PUT, providing new representation Delete DELETE, removes resource 14 14

  14. Level Three Multiple endpoints, identifying resources Understands HTTP (multiple verbs) Uses hypermedia to communicate protocols (shared state) Hypermedia HTTP URI 15

  15. HATEOAS Hypermedia As The Engine Of Application State Resource representations include links to related resources Links that represent a transition to a possible future state of the current resource Link types used to indicate operations (HTTP verbs?) that may be used on the indicated resources State transitions constitute application protocol 16 16

  16. Further Reading Richardson, L. and Ruby, S. (2007) RESTful Web Services. Sebastopol, CA: O'Reilly. Webber, J. et al (2010) REST in Practice. Sebastopol, CA: O'Reilly Webber, J. et al (2009) REST in Practice: A Tutorial on Web-based services https://www.slideshare.net/guilhermecaelum/rest-in-practice 17

  17. Next Lecture: REST in Practice

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#