Saturday, August 15, 2015

WCF services VS Web services in Asp.net

In this article I am going to differentiate the WCF service and web service.

In the previous article I have explained Introduction to WCF.


Web service
WCF service
Web service is available in the namespace System.Web.Services.Webservices
WCF service is available in the namespace System.ServiceModel
It is hosted only in IIS.
WCF is hosted in IIS, WAS (Window activation service), self hosting and managed window service.
It is supported only HTTP and HTTPS protocol.
It supports various protocol i.e.  HTTP, HTTPS, WS-HTTP, TCP/IP and MSMQ.
Web services have .asmx extension.
WCF services have .svc extension.
[webservice] and [webmethod] attributes are used to define the web service.
[ServiceContract] and [OperationContract] attributes are used to define the WCF service.
It is support security but less secure as compare to WCF services.
WCF supports security, reliable messaging and transaction. It is more secure compare to web services.
It supports one way and request-response service operations.
It supports the one way, two way (duplex) and request-response operations.
It is used for XML serializer.
It is used for DataContarct serializer.
In web services hash table cannot be serialized.
In WCF hash table can be serialized.
Performance wise web services are slow.
WCF is faster than web services.
It doesn’t support multithreading.
It supports the multi threading by using ServiceBehaviour class.
It supports XML and MTOM (Message transmission optimization Mechanism)
It supports XML, MTOM (Message transmission optimization Mechanism) and binary message encoding.
Unhandled exceptions are returned to the client as SOAP faults.
Unhandled exceptions are not return to the client as SOAP faults. WCF support better exception handling by using fault contract.

In this article we have know the difference between WCF service and Web serviceI hope you enjoyed this article.

1 comment:

  1. Please Make Tutorials on M.V.C Also......specially J.query Ajax....and Json in MVC

    ReplyDelete