Ask HN: SOAP or RESTful

1 points by thatusertwo ↗ HN
I'm working with a client, I've been asked to develop an Android App and an iPhone App. The app requires access to an online database so it needs a Web Service.

The client requires that the web service be developed on a .NET 4.0 server with VB.

I've found examples online of both methods, although RESTFul seems to be a little more hacky.

What way should I go?

4 comments

[ 3.9 ms ] story [ 6.9 ms ] thread
Not sure I understand why you say RESTful is more hacky, but I have recently done exactly the same type of project. Except we used C#.

There are a lot of reasons we went RESTful but some are:

1) XML parsing is very CPU intensive for mobile devices and can quickly drain battery life.

2) Payload of SOAP is much larger than JSON, meaning that you are tying up resources and network bandwidth for mobile devices.

3) RESTful intent is easy to understand, POST/GET/PUT etc. Especially if you are interacting with a DB.

4) Coding was simple in both the .NET and the mobile side, at least in comparison of dealing with XML all the time.

5) Performance is generally better, again most of this is thanks to the payload size.

6) Using RESTful allowed us to also reuse the same API's on the website and consume them in JavaScript natively. No extra layers of translation or craziness involved.

Not saying XML doesn't have its uses, but I would not use SOAP again unless forced to interact with a system that required it. I hate bloat, and performance is eaten in CPU cycles wasted on parsing bloat when it comes to SOAP.

I should note, nothing about RESTful says you have to use JSON, you could return XML payloads. To me returning XML for this type of usage is just a bad idea most of the time.

(comment deleted)
thanks for the feedback, thats a great answer and addresses most of the concerns that I had.

By hacky I meant that RESTful with VB.NET isn't the default way of doing things.

Cool, glad it helped some.

I get the hacky now; I have personally never been a VB fan so that is my own bias, not to say I haven't used it when a client says to though.