ASP.NET - Difference between WCF and Web Services.

Difference between WCF and Web Services.

WCFWeb services
It is hosted in 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 comparatively lower 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!”;
}
}
WCF - What are different bindings supported by WCF?
What are different bindings supported by WCF? - BasicHttpBinding, WSHttpBinding...
What is duplex contract in WCF?
What is duplex contract in WCF? - Duplex contract: It enables clients and servers to communicate with each other....
Explain the different transaction isolation levels in WCF.
Different transaction isolation levels in WCF - Read Uncommitted, Read Committed, Repeatable Read, Serializable, Snapshot...
Post your comment