4

First of all: I´m from germany, so sorry for my english.

I read a lot about REST and SOAP and figured out many pros and cons, but I´m still not sure which one to use for my application. My application should provide an API for creating, deleting, updating and receiving data. So I thought of implementing it the REST way. It should also be possible to post big data (such as videos) to my API and this API should only be usable by authenticated persons.

Does the last two constraints force me to choose SOAP over REST or is it (easily) possible to authenticate users via a REST API?

Thanks in advance

Rainer Sauerstoff
  • 279
  • 1
  • 3
  • 8

1 Answers1

1

SOAP has more overhead then REST. So I would prefer to use REST in your case.

There are different ways to add authentication to any web service.

You could use a "ticket" within the methods or use cookies or other custom header of the http protocol

stefan bachert
  • 9,413
  • 4
  • 33
  • 40
  • Thanks for your reply. Are there any critical disadvantages I must consider when using REST for such a task? – Rainer Sauerstoff Apr 12 '12 at 13:30
  • Usually huge data is limited by the container (Tomcat and Co). I know there is a possibility to update in chunks but I never did it. – stefan bachert Apr 12 '12 at 14:33
  • Ok thanks for your reply. I pointed out the following advantages from REST over SOAP or RPCs. Did I miss anything important? **pros:** http as protocol (important for firewalls), scalability, loose coupling, proven standards (http, json etc.), bookmarkeable, search engine friendly, independent from programming language, less overhade than SOAP, caching possible **cons:** not so good IDE support, needs more know-how – Rainer Sauerstoff Apr 12 '12 at 14:36
  • Sorry, but 1) SOAP IS protocol-independent, REST is bound to HTTP. 2) Scalability and loose coupling speaks for SOAP as well. 3) SOAP is also based on proven standards (XML, XSD, WSDL, etc) 4) SOAP is also independant of the programming language (-> SOAP IS XML). 5) Last but not least: There are hundres of those kind of "REST vs SOAP" questions here in stackoverflow.com – Aydin K. Apr 13 '12 at 09:55
  • Yes, you´re right. I wrote that this comparison is between REST vs. SOAP vs. RPCs. The arguments you´ve mentioned are meant to be for REST vs. RPCs. And yes, there are a lot of these discussions out there, but I try to find comprehend them and detect possible risks that can be dangerous for my application. – Rainer Sauerstoff Apr 13 '12 at 11:44