Webservice vs API

To understand Web services clearly, one has to understand what an API is. API stands for Application Programming Interface. It is basically a set of functions exposed by an application/module to be used by another application/module. Under this terminology, the application using the exposed function is called Consumer and application that is exposing the functions is called Provider.

Although you can assume that a Web service is a subset of the generic term API,here are some of the subtle differences between API and Web services:

1) In API, both consumer and provider software reside inside same machine whereas in Web service, both software are in the different machines.
2) Network is not needed in case of API whereas both the machines should be connected to same network in case of Web service.
3) Web services are language independent whereas API can be language independent
4) Web services might not perform all the operations that an API would perform.They are mostly used when we want to request some data from the server.

From above points, we can infer that All Web services are APIs but all APIs are not Web services or we can also say that a Web service is simply an API wrapped in HTTP.




3 replies »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s