简体   繁体   中英

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 . So 99% of data comes from the user's input to forms and sent to views.

Now I would like to implement web-service based on ASP.NET : here what I want to do:

  • My mates write the same application on Android and 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).
  • Respectively, web-service should send back some data.

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.

I want to do it with hosting the server on 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?
  3. Will I need to write my own API or there are ready solutions for cross platform communication (data-exchange)?

You should learn ASP.NET Web API and not use a ASP.NET WCF web service. WCF is not cross platform compatible. 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.

I don't see any reason why you shouldn't use Azure if that's what you're comfortable with. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM