简体   繁体   中英

.NET web services for mobile application

I have to prepare web service for iOS and Android applications. My platform will be .NET with C#. Now I am not sure which of the following is the best option to follow.

  1. WCF SOAP XML Service
  2. WCF SOAP JSON Service
  3. WCF REST XML Service
  4. WCF REST JSON Service
  5. ASMX SOAP XML Service
  6. ASMX SOAP JSON Service
  7. ASMX REST XML Service
  8. ASMX REST JSON Service

So far I have worked with only ASMX SOAP service and these are very easy to use and develop but I got some suggestion from iOS developers that JSON is good for their development. Some times they also suggested to prepare REST services but according to me they are less secure.

Please let me know which one of the above eight approach is best for small user base application and which one is best for large user base application.

Since iOS and Android doesn't have too much SOAP implementations available, a large number of developers (including me) are choosing REST based web services.

The are several reasons to choose for REST services over SOAP webservices, one of them is simplicity, REST webservices usually requires the implementation of HTTP requests plus the generation of request body in a plain JSON or XML.

SOAP requests only differs on its extra details about the resource being requested, these additional details/bytes, may become a problem while coding the request on client side and, of course, cause an overhead on transmission.

By implementing webservices over REST you can take advantage of two awesome libraries, for iOS you have Restkit , and on Android you can use restlet with jackson .

Based on what has been said above, I strongly suggest WCF REST XML Service or WCF REST JSON Service, where WCF REST JSON will be the most performatic option, since the serialization format (JSON) is much more efficient way to represent data to be transferred over network connection.

Take a look at ServiceStack :

Service Stack is a high-performance .NET web services platform that simplifies the development of high-performance REST (JSON, XML, JSV, HTML, MsgPack, ProtoBuf, CSV) and WCF SOAP Web Services.

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