What Is the Difference Between a Web Api and a Web Service?
Is There Any Difference Between a Web Api and a Web Service? or Are They One and the Same? 5 13 Answers a Web Service Typically Offers a Wsdl from Which You...
Is there any difference between a web API and a web service ? Or are they one and the same ?
13 Answers
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.
The basic difference between Web Services and Web APIs
Web Service:
1) It is a SOAP-based service and returns data as XML.
2) It only supports the HTTP protocol.
3) It is not open source but can be used by any client that understands XML.
5) It requires a SOAP protocol to receive and send data over the network, so it is not a light-weight architecture.
Web API:
1) A Web API is an HTTP based service and returns JSON or XML data by default.
2) It supports the HTTP protocol.
3) It can be hosted within an application or IIS.
4) It is open source and it can be used by any client that understands JSON or XML.
5) It has light-weight architecture and good for devices which have limited bandwidth, like mobile devices.
Just pasted the summary of the linked article:
Summary:
All Web services are APIs but all APIs are not Web services.
Web services might not perform all the operations that an API would perform.
A Web service uses only three styles of use: SOAP, REST and XML-RPC for communication whereas API may use any style for communication.
A Web service always needs a network for its operation whereas an API doesn’t need a network for its operation.
An API facilitates interfacing directly with an application whereas a Web service is a ...
Read more: Difference Between API and Web Service | Difference Between | API vs Web Service
See the above link for the complete answer.
for more detail visit this link
A Web Service if you want is a Web API. Specifically Web API usually means RESTful (HTTP based) web service and Web Service usually means SOAP+WSDL (+HTTP or SMTP or JMS..).
Tipically RESTful web services are opposed to Web Services (WSDL,SOAP) but recently it has been introduced the term RESTful Web services (with uppercase 'W') that means RESTful+WSDL+SOAP..
Check out this chart for differences among the three concepts:
Hope it helps!
Web service is absolutely the same as Web API - just a bit more restricted in terms of underlying data format. Both use HTTP protocol and both allows to create RESTful services. And don't forget for other protocols like JSON-RPC - maybe they fit better.
API and Web service serve as a means of communication.
The only difference is that a Web service facilitates interaction between two machines over a network. An API acts as an interface between two different applications so that they can communicate with each other. An API is a method by which third-party vendors can write programs that interface easily with other programs. A Web service is designed to have an interface that is depicted in a machine-processable format usually specified in Web Service Description Language (WSDL)
All Web services are APIs but not all APIs are Web services.
A Web service is merely an API wrapped in HTTP.
This here article provides good knowledge regarding web service and API.
- Web service is a collection of open source protocols and standards used for exchanging data between systems or applications whereas API is a software interface that allows two applications to interact with each other without any user involvement.
- Web service is used for REST, SOAP and XML-RPC for communication while API is used for any style of communication.
- Web service supports only HTTP protocol whereas API supports HTTP/HTTPS protocol.
- Web service supports XML while API supports XML and JSON.
- All Web services are APIs but all APIs are not web services.
In the context of ASP.Net a Web API is a Controller whose base class is ApiController and does not use Views. A Web Service is a class derived from WebService and has automatic WSDL generation. By default it is a SOAP api, but you can also use JSON by adding a ScriptServiceAttribute.
Well, TMK may be right in the Microsoft world, but in world of all software including Java/Python/etc, I believe that there is no difference. They're the same thing.