First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
首先需要了解的是,WCF服务提供了.net web 服务的所有功能,并且对其有所扩展。

Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
ASMX Web服务用于使用HTTP协议进行SOAP消息的接收和发送而设计。但是WCF服务则可以使用任何消息格式(SOAP默认),任何传输协议进行数据交互(HTTP,TCP/IP,MSMQ,命名管道等)。

ASMX is simple but limited in many ways as compared to WCF.
ASMX很简单但是和WCF比起来,却存在诸多限制。

1.ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
a. IIS
b. WAS (Windows Process Activation Services)
c. Console Application
d. Windows NT Services
e. WCF provided Host
1.ASMX Web服务只能够被IIS寄宿,但是WCF服务却可以有如下的寄宿方式:
a.IIS
b.WAS(Windows Process Activation Services Windows进程激活服务)
c.控制台程序
d.Windows NT服务
e.WCF自寄宿

2.ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.
2.ASMX web服务只能支持HTTP传输,但是WCF支持HTTP,TCP,MSMQ,命名管道。

3.ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.
3.ASMX在安全控制方面功能有限,包括普通的验证,基于IIS的验证,Asp.net安全配置,传输层安全控制。对于应用层安全来说,可以使用WSE来进行。
WCF则为所有的传输协议提供一致的安全验证模块,同时它支持类似于IIS和WS-*的安全协议,此外,它还支持提供比role-based更加细粒度的针对资源操控的Claim-based验证. WCF安全验证和寄宿主体无关。

4.Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. Only public fields or properties of the .NET types can be translated to Xml.
b. Only the classes that implement IEnumerable can be translated.
c. Classes that implement IDictionary, such as Hashtable cannot be serialized.
4.另外一个主要的区别是,ASMX Web服务使用XmlSerializer进行序列化,但是WCF使用DataContractSerializer。后者在性能上完爆。
对于XmlSerializer进行.NET类型序列化来说,问题有以下几点:
a.只有PUBLIC字段或者属性才能够被转换成xml
b.只有实现了IEnumerable接口的类才能够被转化。
c.只有实现了IDictionary的类才能够被转化。比如说HashTable

WCF与ASMX Web服务差异比较[译]的更多相关文章

  1. 项目中使用WCF替换asmx Web service总结

    以前项目解决方案中,用http协议的asmx Web service作服务器数据访问入口,在SoapHeader中写入用户名和加盐密码进行身份认证. http asmx服务是明文传输,传输过程中数据很 ...

  2. WCF服务部署到IIS上,然后通过web服务引用方式出现错误的解决办法

    本文转载:http://www.cnblogs.com/shenba/archive/2012/01/06/2313932.html 昨天在用IIS部署一个WCF服务时,碰到了如下错误: 理解了文档内 ...

  3. 使用 ServiceStack 构建跨平台 Web 服务

    本文主要来自MSDN杂志<Building Cross-Platform Web Services with ServiceStack>,Windows Communication Fou ...

  4. ASP.Net Web 服务 – 如何使用会话状态

    在上次博客帖子中,我们讨论了客户端对web服务的使用.在这篇文章中我们将复习一下如何使用web服务的会话状态. 这是上一篇文章的延续.因此请迅速的回顾之前的文章以便有一个清晰的概念. 在web服务中要 ...

  5. 使用 ServiceStack 构建跨平台 Web 服务(转)

    出处:http://www.cnblogs.com/shanyou/p/3348347.html 本文主要来自MSDN杂志<Building Cross-Platform Web Service ...

  6. WCF、WebAPI、WCFREST和Web服务的差异 ASP.NETMVC和ASP.NETWebAPI的差异

    WCF.WebAPI.WCFREST和Web服务的差异: Web服务 它是基于SOAP和XML的形式返回数据. 它仅支持HTTP协议. 它是开放源,但是不消耗任何客户端可以同时理解XML. 它可以仅在 ...

  7. 从开发的角度比较 ASP.NET Web 服务与 WCF

    Windows Communication Foundation (WCF) 具有一个 ASP.NET 兼容模式选项,用户使用此选项可以对 WCF 应用程序进行编程和配置,使其像 ASP.NET We ...

  8. WCF入门(三)---WCF与Web服务/Web Service

    下面列出了WCF和Web服务之间存在一些重大差异. 属性:WCF服务是通过定义ServiceContract和OperationContract属性,而在Web服务,WebService和WebMet ...

  9. wcf通过webHttpBinding方式发布rest web服务

    <system.serviceModel> <services> <service name="ServiceUpdater.ServiceUpdate&quo ...

随机推荐

  1. iOS开发之保存照片到自己创建的相簿

    iOS开发之保存照片到自己创建的相簿 保存照片还可以用ALAssetsLibrary,ALAssetsLibrary提供了我们对iOS设备中的相片.视频的访问,是连接应用程序和相册之间访问的一个桥梁. ...

  2. C++语言-03-类与对象

    类 类是面向对象编程中的核心概念,用于定义一个数据类型的蓝图,描述类的对象包括什么,以及可以在这些对象上执行那些操作. 类的成员 数据成员 描述数据的表示方法 class ClassName { ac ...

  3. Git基本使用命令

    整理Git的一些基本使用命令.   # 1)克隆代码 boldseas@lian-PC MINGW64 /d/TestGroup $ git clone ssh://git@code.boldseas ...

  4. [Tomcat]如何在同一台机部署多个tomcat服务

    背景:往往不知情的同学在同一台机器上部署多个tomcat会发现第二个tomcat启动会报错.而有些同学会想到可能是端口重复,然而,在server.xml改了端口还是发现不行.其实要想实现同一台机器部署 ...

  5. Linux 环境变量的配置

    一. 环境变量相关的几个配置文件(针对bash): 1.  /etc/profile 系统环境变量配置文件:针对整个系统的所有用户生效,系统启动后用户第一次登陆时,此文件被执行,并从/etc/prof ...

  6. Sublime Text3 C++及Java开发环境配置

    一.C++开发环境配置 1. 下载MingW 2. 环境变量配置,系统属性->高级设置->环境变量,如果Mingw装在c盘更目录,其它自己思考 (1)PATH  变量值中加入 C:\Min ...

  7. Less里css表达式的写法

    项目中用的grunt-contrib-less, 写了以下less代码 .mapfix{ position: fixed; top:10px; width: 430px; z-index: 100; ...

  8. 迅为4412开发板支持AVIN视频输入/AV监控摄像头输入模块

    AVIN模块(iTOP-4412开发板专用) 产品介绍:视频输入/AV监控摄像头输入模块: 该模块及配套的软件为开发视频采集.监控.车载后视等产品提供了很好的参考. iTOP-4412 开发平台 开发 ...

  9. python Basic usage

    __author__ = 'student' l=[] l=list('yaoxiaohua') print l print l[0:2] l=list('abc') print l*3 l.appe ...

  10. 开发一个App要多少钱?APP开发报价单,APP开发外包有哪些注意事项-广州达到信息www.ddapp.com.cn

    来源:广州达到信息著作权归广州达到信息所有.商业转载请联系作者获得授权,非商业转载请注明出处. 作为一个APP开发从业者,经常会有人问到:开发一个App要多少钱?下面针对这个问题来好好解答解答正经的谈 ...