in Technology by
What are the differences between ASP.NET Web Service and WCF?

1 Answer

0 votes
by

The differences between ASP.NET Web Service and WCF are given below:

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 is faster than Web Services.

Web Services are slower than WCF

HashTable can be serialized.

HashTable cannot be serialized. It can serialize 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.

Related questions

0 votes
    What are the differences between ASP.NET HttpHandler and HttpModule?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 31, 2022 in Education by JackTerrance
0 votes
    Explain differences between the page execution lifecycle of an ASP.NET page and an ASP.NET AJAX page?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    How to get ASP.NET Web API to return JSON instead of XML using Chrome?...
asked Jan 11, 2021 in Technology by JackTerrance
0 votes
    We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    I've created a medium-sized web-based automation project for a university (VS2010,C#,ASP.NET,SQL Server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    How can we improve the Performance of an ASP.NET Web Page?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
0 votes
    What are the differences between web sockets as well as REST?...
asked Jun 23, 2021 in Technology by JackTerrance
0 votes
    What is the difference between WCF and Web services?...
asked Apr 1, 2021 in Education by JackTerrance
0 votes
    A client uses classic ASP to log in to their web based backoffice. I have written a new ASP.Net ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    What is the difference between HttpContext.Current.Items and HttpContext.Current.Session in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    Say I have a page that display search results. I search for stackoverflow and it returns 5000 results, 10 per page. Now I ... was posted previously etc.. What I'd like to do is...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Say I have a page that display search results. I search for stackoverflow and it returns 5000 results, 10 per page. Now I ... was posted previously etc.. What I'd like to do is...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    What are the main components of WCF Service?...
asked Jul 26, 2021 in Technology by JackTerrance
...