4. REST 打哪來 ? # 2 Client (Server) Request: GET https ://.../customers/1/orders Response: Content-type: XML https://.../orders/00131 https://.../orders/00832 https://.../orders/00759 Server db3n2u.sinica.edu.tw/~textdb/ap … /orders/ { id } POST / GET / PUT / DELETE /customers/ { id } POST / GET / PUT / DELETE /customers/ { id } /orders POST / GET / PUT / DELETE
Service-oriented architecture , a computer systems architectural style for creating and using business processes, packaged as services . http://en.wikipedia.org/wiki/Service-oriented_architecture IT 資源 >> 服務 ( 設計層次高於 function, component, procedure) Web Service : Web APIs that can be accessed over a network, 可實現 xOA 的技術集合 http://en.wikipedia.org/wiki/Web_service RPC : distributed function (method) call interface. Mapping directly language-specific functions. SOAP : message, rather than an operation. REST : interacting with stateful resources. Roy Fielding , one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification. Style : (guideline) network architecture principles, outline how resources are defined and addressed. (Simple interface, Domain-specific data, Non-additional info) distributed hypermedia systems : such as the World Wide Web. ROA : 2007 book, RESTful Web Services. Every resource is a service. (Four concepts, four properties)
https: TCP/IP model > Application Layer > HTTP
Four concepts Resource : could be a physical resource, or even a person. Can be described by a representation. Name : URI for use in hypermedia links. Representation : HTTP header Content-type, describe the resource (XML / HTML / JSON / link). Link to : response to other resources. Four properties Addressability : set as URIs and allows clients to manipulate their state. Uniform interface : verbs reacting criteria (GET / PUT / POST / DELETE). Statelessness : server only keeps resource state; client keeps application state. Connectedness : have a set of links (URIs). REST principle > protocol : client-server, stateless, cacheable, layered (intermediaries)
WSDL: an XML -based language that provides a model for describing Web services .