WCF | Web 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!”; } } |