Lot of times I have seen people
easily got confused between Web Service and API.
So, in this article we are
going to discuss some of the important difference between them.
Before looking into the actual
differences let’s check out some basics of web service and API.
What is an API?
API (short
for Application Programming Interface) is a protocol that serves as a
means of data transfer between different applications or program functions.
Basically, it’s a set of rules that tell your application how to behave and
where to go. This technology is fast and convenient for users.
For
example, you are using an API when paying for your new clothes online
with a credit card. The Ecommerce platform sends you to your bank’s website to
confirm the card data, and then right back.
What is Web Service?
A Web Service is defined by the
W3C as "a software system designed to support interoperable
machine-to-machine interaction over a network"
S.No
|
Web-Service
|
API
|
1
|
All Web Services are API.
|
All API are not web services.
|
2
|
Web service uses only three
styles of use: SOAP, REST and XML-RPC for communication.
|
API may use any style for
communication.
|
3
|
Web Services are self-contained.
|
API are open source and can be used anywhere.
|
4
|
It can only be hosted on
IIS(Internet Information Service).
|
It can be hosted within
application or IIS.
|
5
|
Web Service might not perform all operation that an API would
perform.
|
API can perform all task that Web service can do.
|
6
|
It requires a SOAP protocol
to receive and send data over the network, so it is not a light-weight
architecture.
|
It is light-weight architecture
and good for devices which have limited bandwidth, like mobile devices.
|
7
|
It needs network for its operation.
|
API does not need network for its operation.
|
Very thoughhtful blog
Reply