2

I am quite new to this and I have a few questions mainly about the backend (server side) implementation of an iPhone client server application.

1) I have looked around and it seems like JSON is a good approach to communicate with a server. What does the server need in order for this to work?

2) I have looked on several tutorials and all the tutorials use urls which are in the format of api.somewebsite.com/rest/... at the momement I only have http://www.websitename.com/Microsoft2.jsp. The user will then login using username and password to access content. Do I need to write an api to get it to work with the above?

I am really new to server implementation so I appologise in advance if they are newbie questions.

Thank you!

Jeff
  • 21
  • 1
  • Have you decided your server implementation/language yet? From there, we could guide you better on how implement your backend service – momo Sep 12 '11 at 12:00

2 Answers2

0

No problem. From my limited experience with this, here is what you'll need. Get the JSON framework from GitHub and the JSON extension for PHP. To authenticate, I'm assuming you'll need ASIHTTPRequest. Just look it up in Google. And that should be it.

Jack Humphries
  • 13,056
  • 14
  • 84
  • 125
0

For the server, there are multiple frameworks and platforms:

  1. C#/.Net: WCF has data contracts and options to serialize JSON/XML etc...
  2. Ruby on Rails with Active record: can serialize data using configuration over your model.
  3. Java: Jersey JAX-RS plus other frameworks are easy.
  4. PHP with json extensions
  5. etc... many others - search

IPhone side:

  1. ASIHttpRequest / SBJSON
  2. NSXmlParser: built into iPhone - if you serialize over the wire as xml.
  3. RestKit: A larger framework that wraps everything including communication and coredata integration.
  4. etc... many others

Concerning XML vs. JSON. Json is great because javascript and web pages can consume it easily (it is javascript object notation :). If you have to choose one, that allows you to get consumed everywhere easily. Not every framework has standard JSON parsers - it's rapidly gaining adoption. For example, iOS 5 has json serializer. Xml is widely adopted across all programmatic languages and frameworks - every framework has a good xml parser. Harder to consume from javascript (but possible - more code).

Hope those pointers help.

bryanmac
  • 38,941
  • 11
  • 91
  • 99