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:
我开始了我的学位项目,一个适用于iPhone,Android和(在不久的将来)Symbian的移动应用程序。服务器体系结构如下:
- web site (for "standard" users);
- 网站(“标准”用户);
- web service (for mobile connections), based on TomCat and Axis2;
- Web服务(用于移动连接),基于TomCat和Axis2;
- mySQL DB to storage users data.
- mySQL DB用于存储用户数据。
Surfing across the web, I've read a lot of discussion about the interaction between the iPhone and Web Services, and I've to say that I've not a clear idea of what I can do and what not. Let's start from the protocol used to retrieve data from the DB: the Android-side application uses SOAP protocol, can I do the same with iPhone? Are there some limitations or problems?
通过网络浏览,我已经阅读了很多关于iPhone和Web服务之间交互的讨论,我要说的是,我不清楚我能做什么,不能做什么。让我们从用于从数据库中检索数据的协议开始:Android端应用程序使用SOAP协议,我可以对iPhone执行相同的操作吗?有一些限制或问题吗?
I have also read about the using of REST instead of SOAP, could it be possible with the server architecture described above? Which are the main advantages/disadvantages?
我还读过有关使用REST而不是SOAP的信息,是否可以使用上述服务器架构?哪些是主要优点/缺点?
Sorry if these questions sound "n00b", but it's my first real experience with iPhone and the lot of informations found on the web messed up my mind and I'm scared to be confused. Forgive me for any error.
对不起,如果这些问题听起来像“n00b”,但这是我第一次使用iPhone的真实体验,而网上发现的大量信息让我心烦意乱,我很害怕感到困惑。原谅我有任何错误。
4 个解决方案
#1
10
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.
SOAP对移动通信来说太沉重了。为什么要在一个额外的XML层中包装请求的所有工作都需要解析?您发送的数据超出了您的需求,并且会给客户端和服务器带来更大的CPU负担。
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.
使用REST。如果您正在进行跨平台项目,JSON会生成一个很好的有效负载容器,否则plist可以很好地从服务器发送数据。
#2
4
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.
你绝对可以在iPhone上做SOAP。这是一个关于这个主题的很好的教程。毕竟,SOAP是一个基于HTTP的协议,您拥有在iPhone上执行HTTP所需的所有库。
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.
话虽如此,RESTful API比SOAP更简单,因此您可能需要考虑它们。它们也是基于HTTP的,所以你在iPhone上做这件事不会有任何问题。在服务器端,如果使用Java,则必须使用JAX-RS来实现该部分。
Hope it helps.
希望能帮助到你。
#3
0
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.
如果您正在寻找与语言和平台无关的解决方案,请查看Google Buffers。您可以轻松地序列化对象以通过电线传输。
This question should get you started in Objective-C.
这个问题应该让你开始使用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.
我也在iPhone应用程序中使用了JSON并取得了巨大的成功。同样,相对语言和平台不可知,但比Google Buffers简单得多。
#4
0
SOAP with Fast Infoset is suited for small devices:
带有Fast Infoset的SOAP适用于小型设备:
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:
JAX-WS 2.0及其参考实现支持Fast Infoset和MTOM / XOP。本文包含有关Fast Infoset与MTOM / XOP的Web服务性能的信息:
http://www.devx.com/xml/Article/35385/1954
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.
Fast Infoset针对具有带宽限制的小型设备进行了优化,并得到许多供应商的支持,如Microsoft .NET和.NET CF,Sun GlassFish,BEA WebLogic,IBM SDK for Java 6.0等。
http://en.wikipedia.org/wiki/Fast_Infoset
http://en.wikipedia.org/wiki/Fast_Infoset
#1
10
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.
SOAP对移动通信来说太沉重了。为什么要在一个额外的XML层中包装请求的所有工作都需要解析?您发送的数据超出了您的需求,并且会给客户端和服务器带来更大的CPU负担。
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.
使用REST。如果您正在进行跨平台项目,JSON会生成一个很好的有效负载容器,否则plist可以很好地从服务器发送数据。
#2
4
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.
你绝对可以在iPhone上做SOAP。这是一个关于这个主题的很好的教程。毕竟,SOAP是一个基于HTTP的协议,您拥有在iPhone上执行HTTP所需的所有库。
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.
话虽如此,RESTful API比SOAP更简单,因此您可能需要考虑它们。它们也是基于HTTP的,所以你在iPhone上做这件事不会有任何问题。在服务器端,如果使用Java,则必须使用JAX-RS来实现该部分。
Hope it helps.
希望能帮助到你。
#3
0
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.
如果您正在寻找与语言和平台无关的解决方案,请查看Google Buffers。您可以轻松地序列化对象以通过电线传输。
This question should get you started in Objective-C.
这个问题应该让你开始使用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.
我也在iPhone应用程序中使用了JSON并取得了巨大的成功。同样,相对语言和平台不可知,但比Google Buffers简单得多。
#4
0
SOAP with Fast Infoset is suited for small devices:
带有Fast Infoset的SOAP适用于小型设备:
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:
JAX-WS 2.0及其参考实现支持Fast Infoset和MTOM / XOP。本文包含有关Fast Infoset与MTOM / XOP的Web服务性能的信息:
http://www.devx.com/xml/Article/35385/1954
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.
Fast Infoset针对具有带宽限制的小型设备进行了优化,并得到许多供应商的支持,如Microsoft .NET和.NET CF,Sun GlassFish,BEA WebLogic,IBM SDK for Java 6.0等。
http://en.wikipedia.org/wiki/Fast_Infoset
http://en.wikipedia.org/wiki/Fast_Infoset