对于.NET Web服务格式/协议适用于Android,iPhone等一体化的建议 [英] Recommendations for .NET Web Service Format/Protocol for Android, iPhone, etc. integration
问题描述
我建立一个Web服务为我的ASP.NET MVC 3的网站。理想情况下,我想所有的客户端(我的网页,iPhone应用,Android应用程序,Windows Phone 7的应用程序等)使用相同的服务层加载和保存数据。
I am building a web service for my ASP.NET MVC 3 website. Ideally I would like all clients (my web pages, iphone application, android application, windows phone 7 application, etc.) to use the same service layer to load and save data.
我是新的移动开发,并想知道如果有一个preferred机制 - SOAP / JSON的/ etc - 使用不同种类的移动设备设置。具体来说,我想知道,如果Android和iOS有一个协议更好的库/支持在另一个或主要的移动平台对所有协议的大力支持。我也想知道如果一切甚至当它涉及到固定所述的服务。
I am new to mobile development and was wondering if there is a preferred mechanism - SOAP/JSON/etc - to use a heterogeneous mobile device setup. Specifically I'm wondering if Android and iOS have better libraries/support for one protocol over another or if the main mobile platforms have strong support for all protocols. I am also wondering if all is even when it comes to securing said services.
任何意见将是多少AP preciated
Any advice would be much appreciated
感谢
JP
推荐答案
我会建议一个REST(FUL)服务使用JSON。
I would suggest a REST(ful) service with JSON.
Android和iOS的具有支持解析XML和JSON库,但是JSON库是有点更容易使用,而且有点快。
Both Android and iOS have libraries that support parsing XML and JSON, however the JSON libraries are a bit easier to use and are a little bit faster.
通过再努力一点,你可以让你的服务提供/消耗XML和JSON。
With a little more effort you could allow your service to provide/consume both XML and JSON.
这将是preferable避免SOAP,因为它是更冗长,不适合于更多的带宽/电池敏感的移动设备。
It would be preferable to avoid SOAP as it is more verbose and not as suitable for the more bandwidth/battery sensitive mobile devices.
这篇关于对于.NET Web服务格式/协议适用于Android,iPhone等一体化的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!