WCF VS的WebAPI和原生移动设备 [英] WCF vs WebAPI and native mobile devices

查看:315
本文介绍了WCF VS的WebAPI和原生移动设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作在一个页面的Web应用程序,是完全基于Ajax的(没有文章)和我现在正在使用ASMX的Web服务,而它的发展。 Web服务使用JSON数据。对于发布,我知道我需要升级到WCF和的WebAPI。

I've been working on a single-page web app that is entirely ajax-based (no POSTs) and for now I'm using ASMX for the web services while it's in development. The web services work with JSON data. For the release, I know I'll need to upgrade to either WCF or WebAPI.

最后,我计划建立本地移动应用,将使用相同​​的Web服务作为Web应用程序的工作。所有的事情都是平等的,如果我有两个,我应该去哪个选项以使Web服务可以与不同的客户端应用程序的工作之间做出选择?

Eventually, I plan to build native mobile applications that will work with the same web services as the web app. All things being equal, if I have to choose between the two, which option should I go with so that the web services can work with different client apps?

感谢。

推荐答案

如果您的应用程序被设计成只能通过从各种平台的移动设备访问,这意味着你将不得不寻找共同的最简单的分母所有这些平台。因此,在其他条款中,如果互操作性是你的关心,你将专注于所有的平台可以使用一个独特的通信技术。

If your application is designed to be only accessible by mobile devices from various platform, it means you will have to find the common easiest denominator for all these platforms. So, in other terms, if interoperability is your concern, you will focus on one unique communication technology that all platform can use.

JSON +静止似乎是许多平台今天共同最简单分母(当然包括移动的)。如果这是你要实现的唯一通讯技术,似乎的WebAPI的不二之选。

JSON + REST seems to be the common easiest denominator for many platforms today (of course including mobile ones). And if that's the only communication technology you will implement, WebAPI seems the obvious choice.

WCF是更具扩展性,更可配置的,可以插不同的绑定,不同的编码,在不同的协议,它实现了SOAP,WS - *,它可以非常快(精心挑选绑定),你也可以做JSON + REST有了它,但你并不需要所有的权力(和WCF可能是因为所有这些功能也相当复杂),你需要什么似乎是简单性和普遍性。鉴于您的要求,我会选择的WebAPI。

WCF is more extensible, more configurable, you can plug different bindings, different encodings, on different protocols, it implements SOAP, WS-*, it can be very fast (with carefully chosen bindings), you can also do JSON+REST with it, but you don't need all that power (and WCF can be also quite complex because of all these features), what you need seems to be ubiquity and simplicity. Given your requirements, I would choose WebAPI.

这篇关于WCF VS的WebAPI和原生移动设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆