小智 5
在花费数小时思考SOAP和REST之间的选择之前,请考虑一些Web服务支持一个和另一个.除非您计划创建自己的Web服务,否则可能已经决定使用哪种协议.极少数Web服务(如亚马逊)都支持这两种服务.您的决策重点往往集中在哪种Web服务最能满足您的需求,而不是使用哪种协议.
SOAP绝对是Web服务访问的重量级选择.与REST相比,它具有以下优势:
Language, platform, and transport independent (REST requires use of HTTP)
Works well in distributed enterprise environments (REST assumes direct point-to-point communication)
Standardized
Provides significant pre-build extensibility in the form of the WS* standards
Built-in error handling
Automation when used with certain language products
Run Code Online (Sandbox Code Playgroud)
REST在大多数情况下更容易使用,而且更灵活.与SOAP相比,它具有以下优点:
No expensive tools require to interact with the Web service
Smaller learning curve
Efficient (SOAP uses XML for all messages, REST can use smaller message formats)
Fast (no extensive processing required)
Closer to other Web technologies in design philosophy
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
489 次 |
| 最近记录: |