aoulhent
aoulhent

Reputation: 303

what kind of web service (REST or SOAP) is more efficient to be called from a mobile application

I have to develop a mobile application, and i want to know if there is a web service framework which make developing easier and offers scalability, security and faster in parsing messages.

Upvotes: 1

Views: 995

Answers (1)

Tianzhen Lin
Tianzhen Lin

Reputation: 2614

In terms of performance and network transport, Web Service is probably the least efficient way to go due to the size of SOAP and the complex XML parsing. If you are open to use AMF, in my experience it is the most efficient implementation. There are numerous server-side supports including Java, .NET, php, ruby, etc.

You may check the performance comparisons of different technologies via this blog, and iOS implementation of AMF can be found here.

In brief, here are my takes on numerous client-server communications:

Web Services (SOAP)

  • Pros: Strongly-typed, verbose, support complex data type, support in many server platforms. Most client would have some kind of built-in support
  • Cons: Extremely bulky in size which is bad for network transport, and complex XML structure would eat into application performance.

Restful XML

  • Pros: Easy to understand, smaller size XML compared to SOAP if designed correctly
  • Cons: Not strongly-typed. You have to write your own XML parser to parse data to your strongly-typed objects. XML parsing in general is slow and inefficient.

JSON

  • Pros: Easy to understand, more compact structure.
  • Cons: Not strongly-typed. Cannot support referenced data. For example, if you return ten children who reference the same parent in their properties, you would end up having ten copies of the same parent.

AMF

  • Pros: Binary data format, strongly-typed, small network footprint and extremely fast serialization and deserialization
  • Cons: Not as widely known.

Upvotes: 2

Related Questions