Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 1 REST (Representational State Transfer) Roger L. Costello XML Technologies Course.

Similar presentations


Presentation on theme: "Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 1 REST (Representational State Transfer) Roger L. Costello XML Technologies Course."— Presentation transcript:

1 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 1 REST (Representational State Transfer) Roger L. Costello XML Technologies Course

2 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 2 Acknowledgements I would like to thank Paul Prescod for his very helpful comments on improving this tutorial, as well as his outstanding articles on REST. Also, thanks to the following people for their comments and suggestions: –Sam Ruby –Mark Baker –Robert McKinnon –Mike Dierken –Amy Kazura –Kit Lueder –Mark Nottingham

3 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 3 What is REST? REST is a term coined by Roy Fielding in his Ph.D dissertation [1] to describe an architecture style of networked systems. [1]

4 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 4 Why is it called "Representation State Transfer"? Resource Client Boeing747.html The Client references a Web resource using a URL. A representation of the resource is returned (in this case as an HTML document). The representation (e.g., Boeing747.html) places the client application in a state. The result of the client traversing a hyperlink in Boeing747.html is another resource is accessed. The new representation places the client application into yet another state. Thus, the client application changes (transfers) state with each resource representation --> Representation State Transfer! Fuel requirements Maintenance schedule...

5 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 5 Representation State Transfer "Representation State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use." - Roy Fielding

6 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 6 Motivation for REST "The motivation for developing REST was to create an architectural model for how the Web should work, such that it could serve as the guiding framework for the Web protocol standards. REST has been applied to describe the desired Web architecture, help identify existing problems, compare alternative solutions, and ensure that protocol extensions would not violate the core constraints that make the Web successful." - Roy Fielding

7 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 7 REST - not a Standard REST is not a standard. You will not see the W3 putting out a REST specification. You will not see IBM or Microsoft or Sun selling a REST developer's toolkit. Why? Because REST is just an architectural style. You can't bottle up that style. You can only understand it, and design your Web services in that style. While REST is not a standard, it does prescribe the use of standards: –HTTP –URL –XML/HTML/GIF/JPEG/etc (Resource Representations) –text/xml, text/html, image/gif, image/jpeg, etc (Resource Types, MIME Types)

8 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 8 REST and the Web The Web is an example of a REST system! All of those Web services that you have been using all these many years - book ordering services, search services, online dictionary services, etc - are REST-based Web services. Alas, you have been using REST, building REST services and you didn't even know it.

9 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 9 Learn by Example This architectural style is best explained with an example. I will present an example of a company deploying 3 Web services using the REST architectural style, then show how they would be deployed using SOAP. After presenting the example I will contrast the REST and SOAP.

10 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 10 Parts Depot Web Services Parts Depot, Inc has deployed some web services to enable its customers to: –get a list of parts –get detailed information about a particular part –submit a Purchase Order (PO)

11 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 11 The REST way of Implementing the Web Services Response (HTML/XML doc) Web Server HTTP GET request URL 1 HTTP response Response (HTML/XML doc) HTTP GET request URL 2 HTTP response HTTP POST URL 3 HTTP response URL to submitted PO PO (HTML/XML) Parts List Part PO

12 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 12 The REST way of Implementing the Web Service Service: Get a list of parts –The web service makes available a URL to a parts list resource. Example, a client would use this URL to get the parts list: Note that how the web service generates the parts list is completely transparent to the client. This is loose coupling. –The web service may wish to allow the client to specify whether he/she wants the parts list as an HTML document, or as an XML document. This is how to specify that an XML document is desired:

13 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 13 Data Returned - Parts List

15 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 15 Data Returned - Part

16 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 16 Questions and Answers What if Parts Depot has a million parts, will there be a million static pages? For example: We need to distinguish between a logical and a physical URL. The above URLs are logical. They express what resource is desired. They do not identify a physical object. The advantage of using logical URLs is that changes to the underlying implementation of the resource will be transparent to clients (that's loose coupling!). Quite likely Parts Depot will store all parts data in a database. Code at the Parts Depot web site will receive each logical URL request, parse it to determine which part is being requested, query the database, and generate the part response document which is returned to the client. Contrast the above logical URLs with these physical URLs: These URLs are clearly pointing to physical (HTML) pages. If there are a million parts it will not be very attractive to have a million static pages. Furthermore, changes to how these parts data is represented will result in impact all clients that were using the old representation. So, no, there will not be a million static pages. Q: A:

17 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 17 Questions and Answers What if I have a complex query? For example: "show me all parts whose unit cost is under $0.50 and for which the quantity is less than 10". How would you do that with a simple URL? For complex queries Parts Depot will provide a service to allow a client to retrieve a form that would then be filled in by the client. When the client hits "Go" the form would gather up the clients responses and generate a URL based upon the responses. Thus, oftentimes the client doesn't generate the URL (think about using amazon - you start by entering the URL to amazon; from then on you simply fill in forms and the URLs are automatically created for you). Q: A:

18 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 18 Questions and Answers How are REST services described? In brief, REST services may be described using WSDL and/or WRDL (Web Resource Description Language). In the future I will describe more details of how this is accomplished. Q: A:

19 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 19 The REST way of Implementing the Web Service Service: Submit a Purchase Order (PO) –The web service makes available a URL to submit a PO. The client creates a PO instance document which conforms to the PO schema that Parts Depot has designed (and publicized in a WSDL document). The client submits PO.xml as the payload of an HTTP POST. Web Server PO.xsd PO.xml HTTP POST conforms to.

20 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 20 Submit PO Service (cont.) The PO service responds to the HTTP POST with a URL to the submitted PO. Thus, the client can retrieve the PO any time thereafter. –The PO has become a piece of information which is shared between the client and the server. The shared information (PO) is given an address (URL) by the server and is exposed as a Web service. Web Server PO.xml HTTP Response URL

21 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 21 Characteristics of a REST-based Network Client-Server: a pull-based interaction style: consuming components pull representations. Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server. Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable. Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE). Named resources - the system is comprised of resources which are named using a URI. Interconnected resource representations - the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another.

22 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 22 SOAP Version We have taken a look at how Parts Depot may implement its services in a RESTful manner. Now let's look at how the services may be implemented using SOAP.

23 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 23 Implementing the Web Services using SOAP Request (XML doc) Response (XML doc) Web Server SOAP envelope HTTP POST URL 1 HTTP Response getPartsList() Request (XML doc) Response (XML doc) HTTP POST URL 1 HTTP Response getPart(id) SOAP Server Note the use of the same URL (URL 1) for all transactions. The SOAP Server parses the SOAP message to determine which method to invoke. All SOAP messages are sent using an HTTP POST. PO (XML doc) HTTP POST URL 1 submit(PO) Response (XML doc) HTTP Response

24 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 24 Note about the SOAP URI URL 1 SOAP Server HTTP POST It is not a SOAP requirement all messages be funneled to the same URL: However, it is common among SOAP vendors to follow this practice. For example, here is the URL for all requests when using Apache SOAP: [host]/soap/servlet/messagerouter getPartsList() getPart(id) submit(PO)

25 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 25 Implementing the Web Service using SOAP Service: Get a list of parts –The client creates a SOAP document that specifies the procedure desired. Then the client will HTTP POST this document to the SOAP server at: The SOAP server takes a quick peek into this document to determine what procedure to invoke.

26 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 26 Data Returned - Parts List Note the absence of links. Why is this? A URL that points to a SOAP service is meaningless since the URL to a SOAP service is just to the SOAP server. Thus, the URL would need to be supplemented with some indication of which method to invoke at that URL. [Note: of course this response could contain a URL to a REST-ful service.]

27 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 27 Implementing the Web Service using SOAP Service: Get detailed information about a particular part –The client creates a SOAP document that specifies the procedure desired, along with the part-id parameter Again, the client will HTTP POST this document to the SOAP server at: Note that this is the same URL as was used when requesting the parts list. The SOAP server peeks into this document to determine what procedure to invoke.

28 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 28 Data Returned - Part Widget-A This part is used within the frap assembly Again, notice the absence of links. Thus, there is nothing in the response to enable a client to "go to the next level of detail". The information about how to go to the next level of detail must be found out-of-band.

29 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 29 Implementing the Web Service using SOAP Service: Submit a Purchase Order (PO) –The client creates a SOAP document that contains a PO instance document (which conforms to the PO schema that Parts Depot has created)... Once again, the client will HTTP POST this document to the SOAP server at: Note that this is the same URL as was used with the other two services. The SOAP server peeks into this document to determine what procedure to invoke.

30 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 30 Data Returned - PO Acknowledgment x fjdsk390f Again, notice the absence of links.

31 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 31 Contrasting REST and SOAP On the next slides I will contrast REST and SOAP in terms of: –Proxy Servers (Web intermediaries) –Transitioning state in a client application –Caching (i.e., performance) –Web evolution (semantic Web) –Generic interface (versus custom interface) –Interoperability –Processing the payload

32 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 32 Letter Analogy My company has a receiving warehouse. All letters and packages first go there, and from there they are distributed. A SOAP Server is analogous to the receiving warehouse - the SOAP Server receives all incoming SOAP messages and then distributes each message to the appropriate application for processing. However, there is one big difference: –No one in the receiving warehouse is allowed to look inside any letter or package. All decisions about what to do with letters/packages must be made purely by looking at the addressing on the outside. Any attempt to look inside of letters/packages is a violation of Federal Law (U.S.). –A SOAP Server, on the other hand, is able to "peek inside" the SOAP envelope. In fact, it must do so because the actual target resource is not specified on the outside, but rather, is hidden within the envelope. With REST all decisions are made based upon the URL and HTTP method. Thus, REST and SOAP have a fundamental difference in this regard. We will see in the next slides that this causes SOAP to clash with the Web.

33 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 33 Proxy Servers Consider this scenario: –A company has deployed 3 resources - Resource 1, Resource 2, and Resource 3 –A client wishes to access Resource 1 (get a representation of Resource 1) –All client requests go through a proxy server –The proxy server enforces the policy that access to Resource 2 and Resource 3 is allowed. However, Resource 1 is off limits (for example, suppose that Resource 1 is Hotmail, and the client's company policy prohibits accessing Hotmail using the company's lines).

34 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 34 Web Server Resource 1 Resource 2 Resource 3 Proxy Server Youre not allowed to access Resource 1 REST and Proxy Servers

35 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 35 REST and Proxy Servers (cont.) The URL identifies the resource that is desired (e.g., Resource 1) The HTTP method identifies the desired operation (e.g, HTTP GET) A proxy server can decide, based upon the identified resource, and the HTTP method whether or not to allow the operation. Desired resource Method Accept/reject

36 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 36 Web Server Resource 1 Resource 2 Resource 3 Proxy Server SOAP Server I cant determine if the message is allowed since I dont know what Resource it is targeting [that information is hidden in the Envelope] SOAP and Proxy Servers

37 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 37 SOAP and Proxy Servers (cont.) The URL is not to the target resource, but rather to a SOAP server. This makes it harder, and less likely, for a proxy server to determine which resource is actually being targeted. The proxy server would need to look inside the SOAP message to determine which resource is being requested. –Further, the proxy server would need to understand the semantics of the message: R1 Does this mean that the client is trying to access Resource 1? The proxy server must understand the semantics of every SOAP application!

38 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 38 SOAP and Proxy Servers (cont.) Proxy Server SOAP message "What resource is this SOAP message trying to access? What is it trying to do with the resource?" There are 2 ways to implement the proxy server: 1. Program the proxy server to understand the semantics of each SOAP application that a client will access. This approach is not scalable - for each new SOAP application the proxy server will need to be updated. 2. If all SOAP messages are written in RDF/DAML then it may be possible for the proxy server to dynamically discover the resource/method being requested.

39 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 39 Web Intermediaries A proxy server is one example of a Web intermediary. Other examples are gateways, caches, etc. A typical Web request may be routed through multiple intermediaries. A Web intermediary will have a much greater chance of making reasonable decisions when a client's request shows, in the clear, the targeted resource, and the method requested is understood. As we have seen with SOAP both the targeted resource, as well as the requested method is nested within the SOAP envelope, thus making it much more difficult for intermediaries to do their job.

40 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 40 State Transitions Let us consider a client application as a state machine - each resource representation that it receives causes it to transition to the next state. S0 S1 Receive Resource 1 Representation S2 Receive Resource 2 Representation... State Transition Diagram for a Client Application

41 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 41 State Transitions in a REST- based Network S0 S1 Receive Resource 1 Representation S2a S2b S2c 2a 2b 2c Receive Resource 2a Representation 3a 3b S3a S3b Receive Resource 3b Representation 4a 4b 4c Each resource representation contains hyperlinks. Following a hyperlink takes the client to the next state. Thus, within the resource representations themselves are pointers to the next states.

42 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 42 State Transitions in a REST- based Network Recall the Parts Depot example. The parts list resource returns this representation:

43 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 43 State Transitions in a REST- based Network Question: If I am sitting at a browser then I can understand how the decision is made on which hyperlink to select (my brain decides). But if this is all being done programmatically, without human intervention, then how will the decision be made on which hyperlink to select? Answer:The XML hyperlinking technology is XLink. With this technology in addition to providing a URL to the target resource, you can also provide data about the resource you are linking to (using xlink:role). If the client application is able to understand the semantics of xlink:role then it will be able to make a decision on which resource to choose next. This is ultra cool - the application is dynamically making decisions about what resources to access (it is becoming a self-propelled automata). If the client application is not able to evaluate the xlink:role attribute then the decision will need to be made out-of-band (that is, the decision must have been made when the application was written).

44 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 44 State Transitions in a SOAP- based Network S0 S1 Receive SOAP from Application 1 S2a S2b S2c Receive SOAP from Application 2a S3a S3b Receive SOAP from Application 3b In a pure SOAP system each SOAP message will be just data, no hyperlinks. Consequently, the decision on which resource to access next must be made out-of-band.

45 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 45 State Transitions in a SOAP- based Network Recall the Parts Depot example. The parts list resource returns this SOAP document: The SOAP document contains no hyperlinks. In the Web world this document is an island, cut off from the rest of the Web. Information about "what to do next" must be obtained elsewhere, i.e., out-of-band.

46 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 46 Why don't SOAP Documents Contain Hyperlinks? In a pure SOAP system, that is where all accesses are to SOAP-based Web services, then each SOAP document will be an island. The reason for this is simple: with SOAP a URL is meaningless by itself. The URL just points to a SOAP server. To be useful the URL must be accompanied by the SOAP message. Note: the SOAP Working Group is currently working on a way to do SOAP HTTP GET.

47 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 47 Caching (i.e., performance) In a network-based application it is ofterntimes the communications which are the bottleneck.

48 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 48 REST and Caching Web Server Resource 1 Cache Server I have a copy in my cache. Here it is. 2a 2b 2c The cache shortens the distance that the client must go to get the data, thus speeding up the request.

49 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 49 REST and Caching (cont.) The results of a resource request contains an indication in the HTTP header of whether these results are cacheable (and when the data will become stale). If the HTTP header says that it is cacheable, then cache servers can make a local copy. Later, if a client requests the same resource then the client can return a cached copy. Cache Server Desired resource Method = GET Forward request Return cached copy

50 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 50 SOAP and Caching When you submit a SOAP message it is always with an HTTP POST, even though the intent of the message may be to "get" data. –So a cache server would not know from the HTTP method whether the client is doing a request. A SOAP URI is always to the SOAP server, not to the actual target –Consequently, a cache server would not know from the URI what resource is being requested. Thus, with a SOAP message the cache server cannot determine (1) if data is being requested, nor (2) what resource is being requested. –Conclusion: No caching possible with SOAP! Cache Server URI to SOAP Server Method = POST "I dont know what is the target resource. Furthermore, I don't even know if the resource is being requested. So, I must forward the request. No caching"

51 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 51 Evolving the Web (Semantic Web) The vision of Tim Berners-Lee is to turn the Web into a semantic Web[1]. One of the key components of his vision is that every resource on the Web have its own URI. –Axiom 0: Universality 1 Any resource anywhere can be given a URI –Axiom 0a: Universality 2 Any resource of significance should be given a URI. The REST style is consistent with this vision - every resource has a logical URI. SOAP URI's are funneled through a single URI to the SOAP server. This is not consistent with the semantic Web vision. [1]

52 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 52 Generic Interface A key feature of REST (and the Web) is that every resource have a generic interface. Namely, access to every resource is accomplished using HTTP GET, POST, PUT, and DELETE. We have seen how the combination of a URI and a generic method set {URI, method} enables Web components to perform useful work: –Proxy Server(URI, method) -> accept/reject –cache(URI, method) -> forward request/return cached representation

53 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 53 Generic Interface (cont.) With SOAP there is no defined set of methods. Each SOAP application is free to define its own set of methods. –Consequently, tools must be customized on a per-application basis. This is not scalable. In the Web, where independent evolution and scalability are of supreme importance, this is not a very attractive idea.

54 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 54 Interoperability The key to interoperability is standardization. The reason why independent resources on the Web are able to interoperate today is because the Web has standardized on: –Addressing and naming resources -> URI –Generic resource interface -> HTTP GET, POST, PUT, DELETE –Resource representations -> HTML, XML, GIF, JPEG, etc –Media types -> MIME types (text/html, text/plain, etc) These are the standards that REST advocates.

55 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 55 Interoperability (cont.) SOAP depends much more on customization: –Addressing and naming resources -> each SOAP message provides its own unique method of naming a resource –Resource interface -> each SOAP application defines its own interface

56 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 56 Processing the Request/Response Payload With both REST and SOAP you need prior agreement on the semantics of the data

57 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 57 Processing the Request/Response Payload Note: if the payload is in the format of RDF or DAML then the client application may be able to dynamically learn the meaning of the response data. As we saw earlier, with REST there are links to the next state built within each response. We hinted earlier at how a client application may be able to reason dynamically about which link to traverse. Thus, dynamic learning of response data combined with dynamic reasoning of link traversals would yield a self-reasoning automata. This is the next step of the Web!

58 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 58 Recommendation In the context of the Web, the REST approach is the preferred and most cost-effective architectural style for implementing services due to its scalability, its ability to allow dynamic connectivity without prior planning, its ability to enable independent evolution of clients and services, and its built-in support for caching and security. There are several major problems with using SOAP in the Web environment: –The resource being targeted is not known simply from the URL. It is hidden within the SOAP message. –The method being invoked is not known from the HTTP method. It is also hidden within the SOAP message. –The set of methods is completely arbitrary. Every SOAP application is free to define its own set of methods. As we have discussed these problems create an impedance mismatch with today's Web - SOAP messages cannot be utilized by proxy servers, cache servers, etc. The lack of URLs within SOAP messages is very foreign to the Web, and isolates itself from the Web. Finally, the evolution of the Web is where every resource is identified with a URI. SOAPs clumping of resources behind a single URI is contrary to the Web vision. So what is the role of SOAP? SOAP is best utilized in closed systems (systems where all participants are known beforehand). In a closed system each participant can be customized to understand the APIs of the other participants and can be optimized for maximum efficiency.

59 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 59 REST Best Practices 1. Provide a URI for each resource that you want (or will want) exposed. This is consistent with Tim Berners-Lee's axioms for the Web, as well as the W3 TAG recommendations. 2. Prefer URIs that are logical over URIs that are physical. For example: Prefer: Over: Logical URIs allow the resource implementation to change without impacting client applications. 3. As a corollary to (2) use nouns in the logical URI, not verbs. Resources are "things" not "actions". 4. Make all HTTP GETs side-effect free. Doing so makes the request "safe". 5. Use links in your responses to requests! Doing so connects your response with other data. It enables client applications to be "self-propelled". That is, the response itself contains info about "what's the next step to take". Contrast this to responses that do not contain links. Thus, the decision of "what's the next step to take" must be made out-of-band. 6. Minimize the use of query strings. For example: Prefer: Over: Rationale: the relationship between 'parts' and '00345' is clear, and you can instantiate subresources of '00345' easily; this is not possible if that information is tucked away in a query string.

60 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 60 REST Best Practices (cont.) 7. Use the slash "/" in a URI to represent a parent-child, whole-part relationship. 8. Use a "gradual unfolding methodology" for exposing data to clients. That is, a resource representation should provide links to obtain more details. 9. Always implement a service using HTTP GET when the purpose of the service is to allow a client to retrieve a resource representation, i.e., don't use HTTP POST.

61 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 61 References Paul Prescod has written several excellent articles on REST: –Second Generation Web Services –REST and the Real World –SOAP, REST and Interoperability –Evaluating XML for Protocol Control Data


Download ppt "Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. 1 REST (Representational State Transfer) Roger L. Costello XML Technologies Course."

Similar presentations


Ads by Google