What is the difference between a webservice and an API? Is the difference more than the protocol used to transfer data? thanks.
相关问题
- Google places autocomplete suggestion without coun
- Karate API Testing - Access variable value across
- How to verify laravel passport api token in node /
- Converting byte array output into Blob corrupts fi
- How to handle “App is temporarily blocked from log
相关文章
- 我用scrapy写了一个蛮简单的爬虫怎么封装成一个api啊
- 后端给前端的API接口是怎么用代码写的
- Using JAX-WS 2.2.5 client with JDK/JRE 1.5
- Convert C# Object to Json Object
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- Android camera2 API get focus distance in AF mode
- How to create base64Binary data?
- Getting all listing images from an Etsy shop
An API (Application Programming Interface) is the means by which third parties can write code that interfaces with other code. A Web Service is a type of API, one that almost always operates over HTTP (though some, like SOAP, can use alternate transports, like SMTP). The official W3C definition mentions that Web Services don't necessarily use HTTP, but this is almost always the case and is usually assumed unless mentioned otherwise.
For examples of web services specifically, see SOAP, REST, and XML-RPC. For an example of another type of API, one written in C for use on a local machine, see the Linux Kernel API.
As far as the protocol goes, a Web service API almost always uses HTTP (hence the Web part), and definitely involves communication over a network. APIs in general can use any means of communication they wish. The Linux kernel API, for example, uses Interrupts to invoke the system calls that comprise its API for calls from user space.
Think of Web service as a web api. API is such a general term now so a web service is an interface to functionality, usually business related, that you can get to from the network over a variety of protocols.
API is code based integration while web service is message based integration with interoperable standards having a contract such as WSDL.
In a generic sense an webservice IS a API over HTTP. They often utilize JSON or XML, but there are some other approaches as well.
another example: google map api vs google direction api web service, while the former serves (delivers) javascript file to the site (which can then be used as an api to make new functions) , the later is a Rest web service delivering data (in json or xml format), which can be processed (but not used in an api sense).
Basically, a webservice is a method of communication between two machines while an API is an exposed layer allowing you to program against something.
You could very well have an API and the main method of interacting with that API is via a webservice.
The technical definitions (courtesy of Wikipedia) are:
API
Webservice