WCF或Web服务(的.asmx)的iOS应用程序?应用程序、Web、WCF、iOS

2023-09-05 04:33:38 作者:江沉晩吟时

我是相当新的Web开发和放大器; Web服务。我一直在玩弄使用C#传统的Web服务(的.asmx)的.NET。有人认为,很多服务现在使用WCF和我在想,如果我要学习WCF和使用与我的iOS应用程序进行通信。

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.

它看起来像WCF会有点学习曲线,因为我没有(在C#中的小经验)在.NET框架的经验。我不知道它值得花时间在WCF或者我应该只使用编写Web服务的传统方式。

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.

有什么建议?

推荐答案

我建议转向清晰WCF中,并使用的的Microsoft Web API 或 ServiceStack 。两者都能为您提供简单的RESTful服务与内容协商的支持 - 即服务应该很容易消耗在iPhone上。

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.

这两个Web API和ServiceStack寻求WCF的东西更简单,更强大的替代。我绝不会考虑使用WCF任何新建code今天。老式的.asmx(SOAP)的服务是完全不可能的。

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.

您可以得到SOAP服务工作在iPhone上,但它比只得到对一个URL很多工作或POST'ing。

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.

请务必看清​​楚this伟大的答案了比较。

Make sure to look at this great answer for a comparison.