views:

1866

answers:

3

I need to use a web service to be able to sync my iphone app with my Asp.Net website. Data needs to be sent both ways. I haven't started building the web service nor the client yet so before I start, what's the best way to do it? Using SOAP, REST? I understand that support for SOAP or REST isn't built-in in iPhone SDK but are there any ready frameworks for the Iphone to use or do I need to build my own parser?

Do you have some tutorial to recommend?

Thanks!

+1  A: 

The one framework that I've used is called JSON Touch. It's an open source project that is very stable. This will give you all you need to make JSON calls back and forth between a web service.

If you're using WCF to create your web service you will have no problem create a JSON web services.

I would highly recommend this over SOAP because there is way too much overhead with SOAP this is not required and will only complicate your development efforts on the iPhone.

Niels Hansen
Thanks for your answer! I'm planning to use the same web service later for Andriod app and Nokia app, do you think its easy to find support for Json there too?
Martin
JSON has pretty much become the tool of choice of AJAX type applications and with Mobile phones when communicating back to a web-server. I don't know much about nokia apps but Andriod you'll have no problem.
Niels Hansen
Looks like Android has JSON built in.http://lamp.epfl.ch/~linuxsoft/android/android-m3-rc22a/docs/reference/org/json/JSONArray.html
Niels Hansen
Nice! My idea is the following: Lets say I have two tables tbl1, tbl2, both online and on iphone. When syncing, first send a request to server to see what tables need updates from server. Then also check on iphone witch tables need updates. For each table that need update connect to server and push update and get updated data back from server. Or is it better to just make one big request instead of one for each table? Sorry, I'm quite a beginner on this..
Martin
A: 

If you want to use SOAP this existing question should help.

How to Access Soap Services from the iPhone

chris.

PyjamaSam
I don't recommend SOAP unless you have to because the web service is already written.
Niels Hansen
yea webservice = much easier
Daniel