JSON or SOAP (XML)?

后端 未结 7 1309
清歌不尽
清歌不尽 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 20:02

    Ah, the big question: JSON or XML?

    In general, I would prefer XML only when I need to pass around a lot of text, since XML excels at wrapping and marking up text.

    When passing around small data objects, where the only strings are small (ids, dates, etc.), I would tend to use JSON, as it is smaller, easier to parse, and more readable.

    Also, note that even if you choose XML, that does not by any means mean you need to use SOAP. SOAP is a very heavy-weight protocol, designed for interoperability between partners. As you control both the client and server here, it doesn't necessarily make sense.

    0 讨论(0)
提交回复
热议问题