[英]What's the right way to organize cross-platform oriented web-service?
May be my question is a bit ambiguous so I'll try to explain it clearly: Normally I work with ASP.NET MVC and write back-end for the websites .可能是我的问题有点模棱两可,所以我会尽量解释清楚:通常我使用 ASP.NET MVC 并为网站编写后端。 So 99% of data comes from the user's input to forms and sent to views.因此 99% 的数据来自用户对表单的输入并发送到视图。
Now I would like to implement web-service based on ASP.NET : here what I want to do:现在我想实现基于 ASP.NET 的网络服务:这里我想做的是:
I have no experience of writing service that get and post data to different platforms but have some idea how to do it: JSON or XML supported by all devices, so before post-get process I should convert data ( no matter CLR, JVM, iOS ) to JSON/XML and get\\post (send, recieve) it.我没有编写获取和发布数据到不同平台的服务的经验,但有一些想法:所有设备都支持JSON 或 XML ,所以在 post-get 过程之前我应该转换数据(无论 CLR、JVM、iOS ) 到 JSON/XML 并获取\\发布(发送、接收)它。
I want to do it with hosting the server on Azure .我想通过在Azure上托管服务器来做到这一点。
Could you prove that I am thinking on the right way or show what mistakes did I do?你能证明我的思考方式是正确的,或者展示我做错了什么吗? Is there any topics I need to learn?有什么我需要学习的主题吗? More clearly, here are the questions:更清楚的是,这里是问题:
You should learn ASP.NET Web API and not use a ASP.NET WCF web service.您应该学习 ASP.NET Web API,而不是使用 ASP.NET WCF Web 服务。 WCF is not cross platform compatible. WCF 不跨平台兼容。 Web API is because it is compatible with the REST (representational state transfer) architecture and all the platforms you mentioned can use REST for their calls to your RESTful API. Web API 是因为它与 REST(具象状态传输)架构兼容,并且您提到的所有平台都可以使用 REST 来调用您的 RESTful API。
I don't see any reason why you shouldn't use Azure if that's what you're comfortable with.如果您愿意,我看不出有任何理由不使用 Azure。 The Android\\IOS applications will be talking to your RESTful API so the backend you use is not relevant to the consumer of you API. Android\\IOS 应用程序将与您的 RESTful API 对话,因此您使用的后端与您的 API 的使用者无关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.