Which web service to be chosen?

2019-08-04 18:52发布

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 will be used to develop the web site. And our API will be mostly used for GET , UPDATE (PUT in http verb)

What i need :

  • 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:

  • Error handling abitliy
  • Simpliciy
  • Caching abitliy

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:

And my googling keywors were : SOAP vs REST , web service suitable for online transaction .

1条回答
Deceive 欺骗
2楼-- · 2019-08-04 19:31

IMO, use 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.
查看更多
登录 后发表回答