Please enable Javascript to correctly display the contents on Dot Net Tricks!
;

Difference between WCF and ASP.NET Web Service

Posted By : Shailendra Chauhan, 20 Mar 2014
Updated On : 21 Mar 2014
Total Views : 98,549   
 

.NET provides various options for creating services under .NET Framework. Before WCF, ASP.NET Web Services are used to ceate service in .NET Framework. Now WCF is the latest programming model for building and developing service-oriented application. WCF allows applications to communicate with each other in distributed environment. WCF is a set of technologies that covers ASMX web services, Web Services Enhancements (WSE), .NET Remoting and MSMQ. In this article, you will learn the differences between ASP.NET Web Service and WCF.

Difference between WCF and ASP.NET Web Service
WCF
ASP.NET Web Service
ServiceContract and OperationContract attributes are used for defining WCF service.
WebService and WebMethod attributes are used for defining web service.
Supports various protocols like HTTP, HTTPS, TCP, Named Pipes and MSMQ.
Supports only HTTP, HTTPS protocols.
Hosted in IIS, WAS (Windows Activation Service), Self-hosting, Windows Service.
Hosted only in IIS.
Supports security, reliable messaging, transaction and AJAX and REST supports.
Support security but is less secure as compared to WCF.
Supports DataContract serializer by using System.Runtime.Serialization.
Supports XML serializer by using System.Xml.Serialization.
Supports One-Way, Request-Response and Duplex service operations.
Supports One-Way and Request-Response service operations.
WCF are faster than Web Services.
Web Services are slower than WCF
Hash Table can be serialized.
Hash Table cannot be serialized. It can serializes only those collections which implement IEnumerable and ICollection.
Unhandled Exceptions does not return to the client as SOAP faults. WCF supports better exception handling by using FaultContract.
Unhandled Exceptions returns to the client as SOAP faults.
Supports XML, MTOM, Binary message encoding.
Supports XML and MTOM (Message Transmission Optimization Mechanism) message encoding.
Supports multi-threading by using ServiceBehaviour class.
Doesn’t support multi-threading.
What do you think?

I hope you will enjoy the both ASP.NET Web Service and WCF. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

 
Recommended for you
 
About the Author
Hey! I'm Shailendra Chauhan full-time author, consultant & trainer. I have more than 6 years of hand over Microsoft .NET technologies and other web technologies like JavaScript, AngularJS, NodeJS etc. I am an entrepreneur, the founder & chief editor of www.dotnet-tricks.com and www.dotnettricks.com. I am author of most popular e-books for technical Interview on ASP.NET MVC Interview Questions and Answers & AngularJS Interview Questions and Answers & LINQ Interview Questions and Answers.
I have delivered 100+ training sessions to professional world-wide over Microsoft .NET technologies such C#, ASP.NET MVC, WCF, Entity Framework and other mobile technologies such Ionic, PhoneGap, Corodva. Read more...
 
Free Interview Books
 
23 APR
NodeJS Development (offline)

Sat, Sun (10:00 AM-12:00 AM IST)

More Details
16 APR
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun (8:00 AM-10:00 AM)

More Details
11 APR
ASP.NET MVC with AngularJS Development (online)

Mon-Fri (7:00 AM-9:00 AM IST)

More Details
19 MAR
ASP.NET MVC with AngularJS Development (online)

Mon - Fri 08:30 AM - 10:30 PM

More Details
12 MAR
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun     (4:00 PM-6:00 PM IST)

25 FEB
NodeJS Development (online)

Mon-Fri     (7:00 AM-9:00 AM IST)

21 FEB
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun     (3:00 PM-5:00 PM IST)

6 FEB
NodeJS Development (offline)

Sat, Sun     (10:00 AM-12:00 PM IST)

31 JAN
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun     (8:00 AM-10:00 AM IST)

31 JAN
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun     (4:00 PM-6:00 PM IST)

4 JAN
.NET Development (offline)

Mon-Fri     (9:00 AM-11:00 AM IST)

BROWSE BY CATEGORY
 
SUBSCRIBE TO LATEST NEWS
 
LIKE US ON FACEBOOK
 
+