JSON or SOAP (XML)?

后端 未结 7 1364
清歌不尽
清歌不尽 2020-12-04 19:05

I\'m developing a new application for the company. The application have to exchange data from and to iPhone.

Company server side uses .NET framework.

For ex

7条回答
  •  伪装坚强ぢ
    2020-12-04 19:51

    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.

提交回复
热议问题