Web 服务——WCF 与 ASMX(“标准") [英] Web Services -- WCF vs. ASMX ("Standard")

查看:37
本文介绍了Web 服务——WCF 与 ASMX(“标准")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个新项目.与常规旧式 Web 服务相比,使用 WCF Web 服务有什么好处吗?

I am working on a new project. Is there any benefit with going with a WCF web service over a regular old fashion web service?

Visual Studio 为两者提供模板.有什么区别?利弊?

Visual Studio offers templates for both. What are the differences? Pros and cons?

推荐答案

什么是常规的老式 Web 服务?"ASMX 服务,还是您也在使用 WSE?ASMX 服务天生就不能互操作,不支持 WS-* 规范,而且 ASMX 是一种老化得非常快的技术.WSE(Web 服务增强)服务确实添加了对 WS-* 的支持,并且可以实现互操作,但 WCF 旨在取代 WSE,因此您应该花时间学习它.我会说,除非您的应用程序是一次性的,否则如果您选择 WCF,您将获得巨大的灵活性并最终获得更好的设计.WCF确实具有超出 [WebMethod] 属性的学习曲线,但在我看来,学习曲线被过度夸大了,而且它比传统的 ASMX 服务成倍强大且面向未来.

What is a "regular old fashioned web service?" An ASMX service, or are you using WSE as well? ASMX services are not naturally interoperable, don't support WS-* specs, and ASMX is a technology that is aging very quickly. WSE (Web Service Enhancements) services DO add support for WS-* and can be made to be interoperable, but WCF is meant to replace WSE, so you should take the time to learn it. I would say that unless your application is a quick an dirty one-off, you will gain immense flexibility and end up with a better design if you choose WCF. WCF does have a learning curve beyond a [WebMethod] attribute, but the learning curve is over-exaggerated in my opinion, and it is exponentially more powerful and future proof than legacy ASMX services.

除非您的时间线根本无法容忍学习曲线,否则您学习 WCF 而不是仅仅坚持使用 ASP.NET Web 服务会对自己大有帮助.应用程序只会越来越分散和互联,WCF 是微软平台上分布式计算的未来.

Unless your time line simply cannot tolerate the learning curve, you would be doing yourself a huge favor learning WCF instead of just sticking with ASP.NET Web Services. Applications will only continue to become more and more distributed and interconnected, and WCF is the future of distributed computing on the Microsoft platform.

这是两者之间的比较.

这篇关于Web 服务——WCF 与 ASMX(“标准")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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