1

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 .

Community
  • 1
  • 1
MD. Sahib Bin Mahboob
  • 20,246
  • 2
  • 23
  • 45

1 Answers1

2

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.
Community
  • 1
  • 1
Kowser
  • 8,123
  • 7
  • 40
  • 63
  • can you please give me any resource which shows that error handling ability is built in with REST? – MD. Sahib Bin Mahboob Sep 07 '12 at 17:19
  • 1
    from the `abstract` of the RFC `...through extension of its request methods, error codes and headers.` REST depends on HTTP's status code for sure. Again you must acknowledge that, REST cant `detect/find` error for you. It will `define what is an error`. If you wish to REST will find those erros, you need to improve your understanding more to what REST/SOAP/Protocol does. I believe you can understand. – Kowser Sep 07 '12 at 18:06