简体   繁体   English

组织面向跨平台的 Web 服务的正确方法是什么?

[英]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 的网络服务:这里我想做的是:

  • My mates write the same application on Android and iOS.我的伙伴们在 Android 和 iOS 上编写了相同的应用程序。 I write web-site with the same functionality.我编写具有相同功能的网站。 The applications collect some data (inputs, Geo-locations, etc.) and should send it to the common DB (SQL Server).应用程序收集一些数据(输入、地理位置等)并将其发送到公共数据库(SQL Server)。
  • Respectively, web-service should send back some data.分别地,web-service 应该发回一些数据。

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:更清楚的是,这里是问题:

  1. What should I learn in order to implement it?为了实现它,我应该学习什么?
  2. Is it good idea to use Azure\\SQLServer with Android\\IOS?将 Azure\\SQLServer 与 Android\\IOS 一起使用是个好主意吗?
  3. Will I need to write my own API or there are ready solutions for cross platform communication (data-exchange)?我需要编写自己的 API 还是有现成的跨平台通信(数据交换)解决方案?

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.

相关问题 在跨平台移动应用中确保每个用户一个帐户的最安全方法是什么? - What's the most secure way to ensure one account per user in a cross-platform mobile app? 制作跨平台 RTMP 流/播放应用程序的正确方法。 Phonegap livu 插件? - The right way to make cross-platform RTMP streaming/playing app. Phonegap livu plugin? 用git开发具有相同内核的跨平台Java应用程序的最佳方法是什么? - What is the best way to develop cross-platform Java applications with the same core, with git? 跨平台记录 - Cross-Platform Logging 跨平台的openGLES? - cross-platform openGLES? 用于移除移动Web应用程序中的地址栏的跨平台方法 - Cross-platform method for removing the address bar in a mobile web app 如何以正确的方式通过跨平台应用获利? - How to monetize a cross-platform app in the correct way? 高效和跨平台的方式来存储任意排序顺序? - Efficient and cross-platform way to store arbitrary sort order? C ++,OpenCV和用于跨平台GPU编程的“什么” - C++, OpenCV and “what” for cross-platform GPU programing 移动浏览器中可滚动div中的滚动条跨平台 - Scrollbars in scrollable div's in mobile browsers cross-platform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM