码迷,mamicode.com
首页 > 其他好文 > 详细

SOAP vs REST

时间:2017-03-11 01:01:22      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:ret   mmu   art   res   patch   .so   wsdl   ica   UI   

SOAP: Simple Object Access Protocol, it‘s protocol.

REST: Representational State Transfer, it‘s architecture style.

 

SOAP supports many transport protocols: HTTP, SMTP etc. only support XML.

REST also supports many transport protocols, not only HTTP/HTTPS. support XML, JSON etc.

 

SOAP is like desktop-application, we need to define WSDL(IDDL) for client and server to communicate. XML-RPC. Client should have the knowledge.SOAP has additional pre-built WS-Security support. JAX-WS. Since it uses XML, the payload is somewhat larger.

REST is like broswer, we just need to know URI and resource. Resource + Methods. Client has no knowledge about details. Stateless, server will not save any state info. REST uses the security in HTTP if REST over HTTP. JAX-RES

Common HTTP Method: Get/Put/Post/Delete. These methods are not mapping to CRUD for DB.

Post: not only for create resource, but also for update, and any other non-standardized operations.

Put: replace resource, just ignore the current state. Replace the whole resource.

Patch: partial update, it will base on current state to just apply diff.

REST must adhere to HATEOAS(Hypermedia as the engine of application state). The available operations are returned in link instead of documentation. Client enters a REST application through a simple URL instead of fixed interfaces or WSDL.

 

SOAP vs REST

标签:ret   mmu   art   res   patch   .so   wsdl   ica   UI   

原文地址:http://www.cnblogs.com/lruihan/p/6533700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!