- 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 the third-party vendors can write programs that interface easily with other programs.
- A Web service is designed to have an interface that is represented in a machine-processable format usually specified in WSDL. Typically, “HTTP” is the most commonly used protocol for communication. Web service also uses SOAP, REST, and XML-RPC as a means of communication.
- API may use any means of communication to initiate interaction between applications.
For example, the system calls are invoked using interrupts by the Linux kernel API.
An API exactly defines the methods for one software program to interact with the other. When this action involves sending data over a network, Web services come into the picture. An API generally involves calling functions from within a software program.
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 interacts with two machines over a network.
- Web service is like advanced Urls and API is Programmed Interface.
- API contains classes and Interfaces just like a program.
- A web service is a form of API (Application Programming Interface).
- An API is used by a computer programmer to establish a link between software applications. This interface can take several forms, a web service is just one of these.
- There are several types of web service. SOAP (Simple Object Access Protocol) is one of the most common. The API takes the form of a service description (WSDL) which is used to automatically generate the program code which makes the connection.
Cheers..!!
No comments:
Post a Comment