JSON or SOAP (XML)?

JSON has several advantages over XML. Its a lot smaller and less bloated, so you will be passing much less data over the network – which in the case of a mobile device will make a considerable difference.

Its also easier to use in javascript code as you can simply pass the data packet directly into a javascript array without any parsing, extracting and converting, so it is much less CPU intensive too.

To code with it, instead of an XML library, you will want a JSON library. Dates are handled as you would with XML – encode them to a standard, then let the library recognise them. (eg here’s a library with a sample with dates in it)

Here’s a primer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)