ASMX到WCF或Web API [英] asmx to WCF or Web API
问题描述
我有我建立一个应用程序,并就目前而言,我建立使用ASMX一些Web服务。最后,应用程序将被部署在Azure上。该网站的服务是非常简单的在他们做的是调用类在处理一切工作的应用程序code文件夹中。
I have an application that I'm building and for the moment, I built some web services using ASMX. In the end, the application will be deployed on azure. The web services are really simple in that all they do is call a class in the AppCode folder that handles all the work.
这是否会更好/更容易/更快/更高性能的移动我的Web服务或WCF对Web API?
Is it going to be better/easier/faster/more performant to move my web services to WCF or to Web API?
感谢您的建议。
PS:我想补充的是,Web服务将需要HTTPS工作。此刻,他们是在HTTP,因为我在开发模式来的。
PS: I want to add that the web services will need to work in HTTPS. At the moment, they're on HTTP because I'm in development mode.
推荐答案
单行:如果你已经有了一个工作code,这是有风险的,以使其与工作code移动到另一个技术住宿
One-liner: if you have already got a working code and it is risky to move it to another technology stay with the working code.
取决于谁在回答。
网页API包含了HTTP和为您提供了灵活性无法与ASMX和WCF。如果你关心HTTP,内容协商,介质类型和你需要你的服务是从任何客户端(包括AJAX)呼吁则Web API。
Web API embraces HTTP and gives you flexibilities not possible with ASMX and WCF. If you care about HTTP, content-negotiation, media types and you need your service to be called from any client (including AJAX) then Web API.
如果您需要能够使用WS *安全标准(例如,使用X509证书,ADFS等),可能改变你的绑定,使用不同的绑定,可扩展性等使用WCF服务于不同的客户。
If you need to be able to use WS* security standards (e.g. using X509 certificates, ADFS, etc), possibly change your binding, serve to different clients using different bindings, extensibility, etc use WCF.
如果您已经有一个工作code,以及所有你关心的是RPC和您的客户总是会使用ASMX然后ASMX坚持下去。
If you already have a working code, and all you care about is RPC and your clients are always going to use ASMX then stick with ASMX.
没有基准,但我的直觉,按降序排列:网页API,ASMX,WCF
No benchmark but my gut feeling, in descending order: Web API, ASMX, WCF
在降序排列:ASMX(因为你知道它),网页API,WCF
In descending order: ASMX (since you know it), Web API, WCF
如果您认识他们,网络API和ASMX然后WCF
If you know them all, Web API and ASMX then WCF
的 PS:这是很好的拿起新技术。从事态发展会(因为你已经转移到Azure中)到新技术的投资是非常重要的。的
这篇关于ASMX到WCF或Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!