iPhone 到 Java EE 远程处理
在开发与 Java (java EE) 服务器通信的 iPhone 应用程序时,我正在寻找有关最佳远程方法调用实践的一些意见。
如今,许多 iPhone 应用程序通常与服务器后端进行通信。我通常更喜欢使用一些 Spring 库用 java 编写服务器。到目前为止,我还没有找到或坚持 iphone->java 服务器通信的明确实践。
您使用了哪些技术解决方案和库来实现这种客户端-服务器通信?
我始终牢记的一件事是,我希望通信协议简单,以便可以添加多个平台,例如,将来添加 Android 和可能的 Blackberry 客户端,它们可以使用相同的协议与服务器通信。
I was looking for some opinions on the best remote method invocation practices when developing iPhone applications that communicate with Java (java EE) servers.
Many iphone applications these days typically talk to a server back end. I typically prefer to write my servers in java using some Spring libraries. So far I have not found or stuck to a definitive practice for iphone->java server communication.
What are some technical solutions and libraries that you have used to implement this kind of client-server communication?
One thing I always keep in mind is that I want the communication protocols to be simple so that multiple platforms can be added for example, in future adding Android and possibly Blackberry clients, that can use the same protocol to talk to the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会选择 JSON。如果您想使用 Spring,请选择 Restful Web 服务。在“webservices Restful spring json”(不带引号)上进行一些谷歌搜索,您会得到一些提示。
JSON 也适合其他语言。我编写了一个使用 JSON 的 iPhone 应用程序,使用
http://code.google.com/p/json-framework。我非常确定 Android 和 Blackberry 都应该能够很好地读取 JSON。
编辑:我忘了提及,我已将此 iPhone 应用程序置于 MIT 许可证下,您可以在 google code 上浏览代码:
http://code.google.com/p/accountadmin/source/browse/#svn%2Ftrunk%2Fiphone%2FFrittRegnskap%2FClasses
I'd go with JSON. If you want to use Spring, go with restful webservices. Do some googling on "webservices restful spring json" (without the quotes) and you'll get some pointers.
JSON will suit you fine with other languages as well. I've written an iPhone application that uses JSON, and that was quite easy with the use of
http://code.google.com/p/json-framework. I'm pretty sure that both Android and Blackberry should be capable of reading JSON just fine as well.
Edit: I forgot to mention that I have put this iPhone application under an MIT license and you can browse the code on google code:
http://code.google.com/p/accountadmin/source/browse/#svn%2Ftrunk%2Fiphone%2FFrittRegnskap%2FClasses
我目前也在做这个工作。我们的后端是 Java EE(带有 Spring),前端当然是 iOS。正如 Knubo 建议的那样,我们使用 JSON 作为有效负载格式。我们所有的 Web 服务也是 RESTful,以便更轻松地处理手机上的 URL 构建和身份验证。
我强烈建议您查看 RestKit,这是一个非常全面的框架,可让您轻松集成您的 RESTful,带有 CoreData 的基于 JSON 的 Web 服务。在极少数需要的情况下,我们还使用 YAJL 手动解析 JSON。
到目前为止,该工具使使用我们的 Web 服务变得轻而易举。
I'm currently doing this for work as well. Our backend is Java EE (with Spring) and then of course the front end is iOS. We use JSON as the payload format, as Knubo suggested. All of our web services are also RESTful to make dealing with URL construction and authentication on the phone easier.
I would highly recommend you check out RestKit, which is a pretty comprehensive framework that allows you to easily integrate your RESTful, JSON-based web services with CoreData. We also use YAJL for parsing JSON manually in the rare cases where that is necessary.
Thus far, that tooling has made it a breeze to work with our web services.
http://code.google.com/p/json-framework 非常有用。
http://code.google.com/p/json-framework is really useful.