What is the difference between a web API and a web service?

sansh picture sansh · Oct 12, 2013 · Viewed 259.9k times · Source

Is there any difference between a web API and a web service ? Or are they one and the same ?

Answer

TMK picture TMK · Oct 13, 2013

A web service typically offers a WSDL from which you can create client stubs automatically. Web Services are based on the SOAP protocol. ASP.NET Web API is a newer Microsoft framework which helps you to build REST based interfaces. The response can be either JSON or XML, but there is no way to generate clients automatically because Web API does not offer a service description like the WSDL from Web Services. So it depends on your requirements which one of the techniques you want to use. Perhaps even WCF fits your requirements better, just look at the MSDN documentation.