[ACCEPTED]-API vs. Webservice-terminology
An API (Application Programming Interface) is 20 the means by which third parties can write 19 code that interfaces with other code. A 18 Web Service is a type of API, one that almost 17 always operates over HTTP (though some, like 16 SOAP, can use alternate transports, like 15 SMTP). The official W3C definition mentions that Web Services don't 14 necessarily use HTTP, but this is almost 13 always the case and is usually assumed unless 12 mentioned otherwise.
As far as the protocol goes, a Web service 7 API almost always uses HTTP (hence the Web 6 part), and definitely involves communication 5 over a network. APIs in general can use 4 any means of communication they wish. The 3 Linux kernel API, for example, uses Interrupts to 2 invoke the system calls that comprise its 1 API for calls from user space.
Basically, a webservice is a method of communication 15 between two machines while an API is an 14 exposed layer allowing you to program against 13 something.
You could very well have an API 12 and the main method of interacting with 11 that API is via a webservice.
The technical 10 definitions (courtesy of Wikipedia) are:
An 9 application programming interface (API) is 8 a set of routines, data structures, object 7 classes and/or protocols provided by libraries 6 and/or operating system services in order 5 to support the building of applications.
A 4 Web service (also Web Service) is defined 3 by the W3C as "a software system designed 2 to support interoperable machine-to-machine 1 interaction over a network"
In a generic sense an webservice IS a API 2 over HTTP. They often utilize JSON or XML, but 1 there are some other approaches as well.
API's are a published interface which defines 18 how component A communicates with component 17 B.
For example, Doubleclick have a published 16 Java API which allows users to interrogate 15 the database tables to get information about 14 their online advertising campaign.
e.g. call 13 GetNumberClicks (user name)
To implement 12 the API, you have to add the Doubleclick 11 .jar file to your class path. The call is 10 local.
A web service is a form of API where 9 the interface is defined by means of a WSDL. This 8 allows remote calling of an interface over 7 HTTP.
If Doubleclick implemented their interface 6 as a web service, they would use something 5 like Axis2 running inside Tomcat.
The remote 4 user would call the web service
e.g. call 3 GetNumberClicksWebService (user name)
and 2 the GetNumberClicksWebService service would 1 call GetNumberClicks locally.
API(Application Programming Interface), the 19 full form itself suggests that its an Interface 18 which allows you to program for your application 17 with the help or support of some other Application's 16 Interface which exposes some sort of functionality 15 which is useful to your application.
E.g 14 showing updated currency exchange rates 13 on your website would need some third party 12 Interface to program against unless you 11 plan to have your own database with currency 10 rates and regular updates to the same. This 9 set of functionality is when already available 8 with some one else and when they want to 7 share it with others they have to have an 6 endpoint to communicate with the others 5 who are interested in such interactions 4 so they deploy it on web by the means of 3 web-services. This end point is nothing 2 but interface of their application which 1 you can program against hence API.
Think of Web service as a web api. API is 4 such a general term now so a web service 3 is an interface to functionality, usually 2 business related, that you can get to from 1 the network over a variety of protocols.
API is code based integration while web 3 service is message based integration with 2 interoperable standards having a contract 1 such as WSDL.
Check this http://en.wikipedia.org/wiki/Web_service
As the link mentioned then Web 7 API is a development in Web services that 6 most likely relates to Web 2.0, whereas 5 SOAP based services are replaced by REST 4 based communications. Note that REST services 3 do not require XML, SOAP, or WSDL service-API 2 definitions so this is major different to 1 traditional web service.
More Related questions