Overview of RESTful Web Services and Service-Oriented Architecture
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.
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
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 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
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
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
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
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
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
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
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
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
Level Two Multiple endpoints, identifying resources Understands HTTP (multiple verbs) No hypermedia to express state/protocol Hypermedia HTTP URI 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
Level Three Multiple endpoints, identifying resources Understands HTTP (multiple verbs) Uses hypermedia to communicate protocols (shared state) Hypermedia HTTP URI 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
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