Skip to main content

Posts

Showing posts with the label WCF

Difference between Web API, WCF and Web Service

So now we have got the basic idea about Web API , now let’s do some comparison of Web API with WCF and web services. Web Service WCF Web API Web services are created as files with .asmx extension. WCF create with .svc extension Web API are simple class file with .cs(for C#) extension. Web API is inherited from “ApiController” and the class name must end with “Controller”. It is SOAP based service and returns data in XML form. It is also based on SOAP and returns data in XML form. Web API is HTTP based service and by default, it returns data in JSON or XML form. It supports only HTTP protocol. It supports various protocols like TCP, HTTP, HTTPS, Named Pipes, and MSMQ. It supports HTTP protocol. It can be hosted only on IIS. It can be hosted within the application or on IIS or using window service. It can be hosted within the application or on IIS. It is no...

Introduction to ASP.NET Web API Features and why should we use Web API?

HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can think of has an HTTP library. The ASP.NET Web API shipped with ASP.NET MVC 4 and is a framework for building HTTP services. ASP.NET Web API is a framework for building web APIs on top of the .NET Framework. With the help of Web API, we can create RESTful  services which can be consumed by a broad range of clients including browsers and mobile devices. Web API Features: ·          Web API is an HTTP Service. ·          It uses HTTP as an Application protocol, not a transport protocol. ·          Web API is an ideal platform for building pure HTTP-based services where the request and response happen with HTTP protocol. ·      ...

Difference between Web Service and WCF

Following are the main difference between Web Service and WCF (Window Communication Foundation) Service: Features Web Service WCF File Extension The file extension is  .asmx The file extension of WCF service is  .svc Programming [WebService] attribute has to be added to the class [ServiceContract] attribute has to be added to the class Hosting It can be hosted in IIS WCF is flexible and it can be hosted in IIS, windows activation service, Self-hosting, Windows service. Serialization Done through XML serializer. Done through DataContractSerializer Serialization Namespace System.XML.Serialization System.RunTime.Serialization Serialization Differences Hash Table cannot be serialized. Only public properties/fields can be serialized The DataContractSerializer translate the Hash table into the XML. Public/Private ...