[iPhone and Web Services]: REST vs SOAP

后端 未结 4 1848
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-14 00:24

I\'ve started my degree project, a mobile application suitable for iPhone, Android and (in the near future) Symbian. The server architecture is the following:

  • web
相关标签:
4条回答
  • 2021-02-14 00:43

    Google Buffers

    If your looking for a language and platform agnostic solution have a look at Google Buffers. You can easily serialise objects for transmission over the wire.

    This question should get you started in Objective-C.

    JSON

    I have also used JSON within iPhone Apps with great success. Again, relatively language and platform agnostic but much simpler than Google Buffers.

    0 讨论(0)
  • 2021-02-14 00:45

    SOAP with Fast Infoset is suited for small devices:

    JAX-WS 2.0 and its reference implementation support both Fast Infoset and MTOM/XOP. This article includes information about Web Service Performance for Fast Infoset vs. MTOM/XOP:

    http://www.devx.com/xml/Article/35385/1954

    Fast Infoset is optimized for small devices that have bandwidth constraints, and is supported by many vendors such as Microsoft .NET and .NET CF, Sun GlassFish, BEA WebLogic, IBM SDK for Java 6.0 and others.

    http://en.wikipedia.org/wiki/Fast_Infoset

    0 讨论(0)
  • 2021-02-14 00:49

    SOAP is simply too heavy for mobile communications. Why do all the work to wrap requests in an additional XML layer you'll have to parse? You send more data than you need to, and impose greater CPU burden on client and server.

    Use REST. If you are doing a cross-platform project JSON makes a great payload container, otherwise plists work well for sending data from the server.

    0 讨论(0)
  • 2021-02-14 01:05

    You can definitely do SOAP on the iPhone. Here is a nice tutorial on the subject. After all, SOAP is a HTTP based protocol and you have all the libraries you need to do HTTP on the iPhone.

    Having said that, RESTful APIs are simpler than SOAP, so you might want to consider them. They're also HTTP based so you won't have any problems on doing that on iPhone. On the server side, if you use Java, you will have to use JAX-RS to implement that part.

    Hope it helps.

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