WCF Vs ASMX Web Services (转)

WCF Vs ASMX Web Services
 
First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
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).
ASMXis simple but limited in many ways as compared to 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
  2. ASMX web services support is limited toHTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.
  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.
  4. Another major difference is that ASMX web services uses XmlSerializer for serialization while WCFuses 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.
 

转载于:https://www.cnblogs.com/liujq008/p/3305977.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值