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. asmx 接受 ajax post,jQuery ajax调用web服务(asmx)触发认证弹出框

    在我的asp.net 4.0电子商务web应用程序中,登录的客户可以点击锚点,如"过去6个月内的订单"或"订单去年"来查看他过去的订单.当点击这样的锚,我做一个 ...

  2. [转载]Java Web 服务,第 1 部分: Java Web 服务在未来一年内的发展

    Java Web 服务,第 1 部分: Java Web 服务在未来一年内的发展 2006 年中,Web 服务领域将发生翻天覆地的变化.对于 Java™ 开发人员而言,这些变化将包括新 Web 服务框 ...

  3. 利用微软Atlas消费外部Web服务

    摘要 为了从Atlas中消费外部Web服务,你可以为这些服务构建一个基于服务器的Web服务代理.幸好,你可以利用Visual Studio和Atlas特征来处理这其中的大部分工作.   一.引言 如今 ...

  4. JQuery中ajax方法访问web服务

      1 $.ajax({     2    3 02    type: "POST",     4    5 03    //注明 返回Json     6    7 04     ...

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

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

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

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

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

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

  8. 学习笔记---Web服务、Remoting、WCF (上) --- Web服务

    自从程序设计诞生起, 如何最大限度的重用代码, 减小编码的重复劳动就是程序员永恒不变的课题. 我们从学习面向对象开始, 先后引入了很多种共享代码的手段, 随着学习的不断深入就越发觉得程序设计的发展过程 ...

  9. asmx文件_将Web服务的实现与ASMX文件分开

    asmx文件 A fellow said recently that he wanted to build a "monster web service" with over 20 ...

最新文章

  1. Shiny平台构建与R包开发(四)——按钮与响应事件
  2. python调用数据集mnist_Python读取MNIST数据集
  3. nyoj-37 回文字符串
  4. New %: % Syntax for HTML Encoding Output in ASP.NET 4 (and ASP.NET MVC 2)
  5. C#判断一个类中有无指定名称的方法
  6. 数字IC验证学习(一)
  7. 我在自学python_我要自学python 自动化-request库
  8. 第一章:第三课 选择器-状态伪类选择器[四]
  9. IDEA 手动导入本地依赖包
  10. c语言16位字节只能用到255,《C语言程序设计》月考试题(第三章).doc
  11. 在磁盘上给文件快速预留一大片空间
  12. mysql x锁 u锁_讲解更新锁(U)与排它锁(X)的相关知识
  13. JS实现联欢会抽奖滚动数字效果
  14. 微信气泡主题设置_微信皮肤主题怎么弄 微信设置更换修改气泡和主题教程
  15. Android字母排序列表效果与开发实现
  16. 马尔科夫链Markov以及空间Markov Matlab代码
  17. 涂书笔记-让读书笔记不再困难
  18. flex实现在交叉轴上的排列
  19. 程序员接私活去哪儿?给大家推荐几个接私活平台
  20. BUUCTF 认真你就输了

热门文章

  1. Linux之less命令
  2. java实例属性_Java 静态属性与实例属性的初始化
  3. 专访尤雨溪:先别管4.0了,Vue CLI重构了解一下
  4. CentOS 7部署rsync备份服务器
  5. Maven中如何配置WAR依赖WAR和JAR的多模块项目结构
  6. jsp引用带参数的js文件,例如 script src=a.js?ctxpath=${base
  7. 你了解中国的中小企业了吗?
  8. java的设计模式你了解多少?
  9. bobsmith电路阻抗原理_串联谐振原理全解析 - 赫兹电力
  10. java 表格树_00030-layui+java 树形表格treeTable