FW: Difference between Web Service and WCF Service

When I am interviewing .NET developers I often ask this question: what is the difference between a Web Service and a WCF service. Many people don't know the exact difference between them, that's why I decided to write a blog about this topic.

Here are the few differences.

  • 1. Web services can be hosted in IIS as well as outside of the IIS. While WCF service can be hosted in IIS, Windows activation service,Self Hosting,WAS and on lots of protocols like Named Pipe,TCP and others.Many people disagree how we can host the web service outside of the IIS but Here is the article for that.http://msdn.microsoft.com/en-us/library/aa529311.aspx.
  • 2. In Web Services Web Service attribute will added  on the top of class. In WCF there will be a Service Contract attributes will be there. Same way Web Method attribute are added in top of method of Web service while in WCF Service Operation Contract will added on the top method.
  • 3. In Web service System.XML.Serialization is supported while in the WCF Service System.RunTime.Serialization is supported.
  • 4. WCF Services can be multithreaded via ServiceBehavior class while web service can not be.
  • 5. WCF Services supports different type of bindings like BasicHttpBinding, WSHttpBinding, WSDualHttpBinding etc.while Web services only used soap or xml for this.
  • 6. Web services are compiled into a class library assembly. A file called the service file is provided that has the extension .asmx and contains an @ WebService directive that identifies the class that contains the code for the service and the assembly in which it is located while in WCF.WCF services can readily be hosted within IIS 5.1 or 6.0, the Windows Process Activation Service (WAS) that is provided as part of IIS 7.0, and within any .NET application. To host a service in IIS 5.1 or 6.0, the service must use HTTP as the communications transport protocol.

Hope this will help you. Happy programming!!!

 

FW: http://beyondrelational.com/blogs/jalpesh/archive/2010/10/29/difference-between-web-service-and-wcf-service.aspx

转载于:https://www.cnblogs.com/aot/archive/2011/01/04/1925688.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值