What is the difference between WCF and Web services? - .NET WCF

What is the difference between WCF and Web services?

WCFWeb services
It is hosted on IIS, Self-hosting, Windows service, WAS (Windows Activation Service).It is hosted on IIS.
It is accessed through HTTP, TCP, P2P, Named pipes.It is accessed through HTTP.
It supports security, reliable messaging, transactions, service oriented, extensibility.It supports security services.
It gives better performance.It gives worse performance.
Hash tables can be serialized.Hash table cannot be serialized.
It can be multithreaded via ServiceBehaviour class.It cannot be multithreaded.
It supports different type of bindings like BasicHttpBinding, WSHttpBinding, WSDualHttpBinding etc.It can only used SOAP or XML for this.
The classes that implement the Idictionary interface can be serialized.The classes which implement IEnumerable and ICollection interface can be serialized.
Example:
[SerivceContract]
public interface ITest
{
[OperationContract]
String ShowMessage();
}
public class Service : ITest
{
public string ShowMessage()
{
return "Hello world!";
}
}
Example:
[WebService]
public class Service :
System.Web.Services.WebService
{
[WebMethod]
public string Test()
{
return “Hello world!”;
}
}
What is duplex contracts in WCF? - .NET WCF
WCF allows duplex messaging pattern. Services can communicate with client through a callback....
What are different binding supported by WCF? - .NET WCF
.NET WCF - Different bindings: Built- in bindings and custom bindings...
How do we use MSMQ binding in WCF? - .NET WCF
Message queue allows applications running at different times to send and read messages from queues....
Post your comment