REST(REpresentational State Transfer)
REST是並不是一種標準,只是一種Web Service的設計風格。RESTful則是另一個用來定義Web Service的名詞。
Representational State Transfer or REST basically means that each unique URL is a representation of some object. You can get the contents of that object using an HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice most of the services use a POST for this).
It is not necessary to use XML as a data interchange format in REST. The format of information(representation) returned can be in XML, JSON, plain text or even in HTML format.
REST architecture is basically focused on two things : Resources and Interface.
嚴格來說REST符合以下幾個條件:
- 一組有限的良好定義操作 well-defined operations (在HTTP中即 GET/POST/PUT/DELETE)
- 一組有限的內容格式 content types,也許包括 可執行的程式碼 code-on-demand (在WWW中即Javascript)
SOAP(Simple Object Access Protocol)
SOAP message are transferred forming the SOAP-Envelope. SOAP is widely criticized for it’s design complexity.
RPC(Remote Procedure Call)
在XML的世界裏頭,有兩種方式來實作RPC(Remote Procedure Call):
1. XML-based RPC
2. SOAP
RPC 應用程式曝露一或多個網路物件,每個有特定的 functions 可以呼叫。在 client 與物件溝通之前,它必須知道這個物件的知識來操作。
REST vs SOAP
The main advantages of REST web services are:
- Lightweight – not a lot of extra xml markup
- Human Readable Results
- Easy to build – no toolkits required
SOAP also has some advantages:
- Easy to consume – sometimes
- Rigid – type checking, adheres to a contract
- Development tools
Reference
2. http://ihower.tw/blog/archives/1542
3. Why RESTful Design for the Cloud is Best, http://www.slideshare.net/galderz/restful-designjbw-summit2010
3. Why RESTful Design for the Cloud is Best, http://www.slideshare.net/galderz/restful-designjbw-summit2010
沒有留言:
張貼留言