要选择哪个 Web 服务? [英] Which web service to be chosen?
问题描述
我必须开发一个像 paypal 这样支持 在线交易 的网站,我需要在其中实施网络服务.简而言之,我需要使用 Web 服务构建一些易于使用的 API.但我真的很困惑从 REST 或 SOAP 中选择哪一个.
I have to develop a site like paypal which supports online transaction where i need to implement web service. In short , I need to build some easy to use API using web service.But i am really confused which one to chose from REST or SOAP.
Java EE 将用于开发网站.我们的 API 将主要用于 GET , UPDATE (PUT in http 动词)
- 错误处理能力:确保调用成功与否的清晰概念.SOAP 内置,但 REST 没有.这是我们必须的要求.
- 简单性:由于我们的 API 将被各种客户使用,因此需要相对较短的学习曲线.在这种情况下,REST 将是一个很好的选择.必须具有属性
- 缓存能力:缓存肯定是一个加分项,因为它可以节省大量资源.SOAP 不支持缓存.这是一个好的和高度优先的要求.
- 人类可读的结果:它可能是调试目的所必需的.但不是必须的属性.
- Error handling ability: A clear conception of ensuring the call has completed successfully or not . SOAP has it built in , but REST does not. It is a must have requirement for us.
- Simplicity: As our API will be used by various clients it needs to have a relatively small learning curve. In this case REST will be a good fit. A must have attribute
- Caching ability: Caching will surely be a plus as it saves a lot of resources. SOAP does not support caching. It is a good to have and high priority requirement.
- Human readable result: It may be necessary for debugging purpose . But not a must have attribute.
现在我应该采取哪种方式至少满足必须具备的和高优先级的要求:
Now which way i should go for at least fulfill the must have and high priority requirements which are:
- 错误处理能力
- 简单
- 缓存能力
我用谷歌搜索了很多,但没有做出决定.如果有人能给我一个除了这两个更好的建议,欢迎你.我只需要一个满足我要求的解决方案就是这样.
I have googled a lot but failed to come into a decision . If anybody can give me a better suggestion other than these two , you are most welcome. I just need a solution which fulfill my requirement that's all.
我在谷歌搜索时发现的一些资源:
Some resources i found while googling:
我的谷歌搜索关键字是:SOAP vs REST,适合在线交易的网络服务.
And my googling keywors were : SOAP vs REST , web service suitable for online transaction .
推荐答案
IMO,使用 REST
.
- It is so simple that you can even explain it to your wife
- Allows caching, caching is okey as long as RESTs concerns are addressed
- Human readable result for a decent limit
- Error handling is default, i mean every
protocol
should define it.
这篇关于要选择哪个 Web 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!