WCF or Web Services (.asmx) for iOS application?

家住魔仙堡 提交于 2019-12-11 03:23:49

问题


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?


回答1:


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 - i.e. 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.




回答2:


I believe a lot of RESTful services for applications such as iOS are delivered via the ASP.net MVC4 "web API".




回答3:


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.



来源:https://stackoverflow.com/questions/11417808/wcf-or-web-services-asmx-for-ios-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!