WCF or Web Services (.asmx) for iOS application?
I am fairly new to web development & web services. I have been playing around with traditional web services (.asmx) in .NET using C#. Someone suggested that a lot of services now use WCF and I was wondering if I should learn WCF and use that to communicate with my iOS app.
It looks like WCF will be a bit of a learning curve as I don't have any experience in .NET frameworks (little experience in C#). I'm not sure if its worth spending the time on WCF or should I just use the traditional way of writing web services.
Any suggestions?
I'd suggest steering clear of WCF, and use either Microsoft Web API or ServiceStack. Both can provide you with simple RESTful services with support for content negotiation - ie the services should be easy to consume on the iPhone.
Both Web API and ServiceStack seeks to replace WCF with something simpler and more powerful. I would never consider using WCF for any greenfield code today. Old style .asmx (SOAP) services is completely out of the question.
You can get SOAP services to work on iPhone, but it's a lot more work than just GET or POST'ing against an URL.
Make sure to look at this great answer for a comparison.
我相信很多针对iOS等应用程序的RESTful服务都是通过ASP.net MVC4“web API”提供的。
ServiceStack has MonoTouch and MonoDroid client release builds.
As one of its core objective ServiceStack supports and runs on Mono . It's also the only .NET web service framework to offer typed end-to-end clients without any code-gen and its message-based approach is optimal for web services.
For more comparisons between the two, here is an existing question on ServiceStack vs WebApi.
链接地址: http://www.djcxy.com/p/71294.html上一篇: 将asmx移植到WCF后清理配置?