Original address: North Cloud software-web Services vs. Web API
Web Services are standardized and defined by the consortium.
WEB Services is published online and can be advertised to a global registry that automatically provides service URLs, service descriptions, interface invocation requirements, parameter descriptions, and return value descriptions. For example, the China Meteorological Bureau can issue weather forecasts. All other websites or mobile apps can access the Web service to get data if they need to integrate the weather forecast feature.
The main design goal of WEB Services is to provide public services.
Web Services is all XML-based. Describe the various aspects of the service (parameters, parameter passing, return values, Service Release discoveries, etc.) in accordance with the standards. To describe all aspects of the Web Services standard, you may need a 2000-page document.
WEB Services also has a standard authentication method (the user identity is verified when not a public service).
Lightweight Web API
Private services used internally by the company, we know its interface URL, so we don't need to discover it automatically. We have its service interface documentation, so we don't need automatic description and automatic invocation.
Even though the features of Web services (auto-discovery, automatic learning invocation) are nice, private services often don't need them.
The Web API is generally based on http/rest, and nothing needs to be defined, parameters (input data) can be JSON, XML or simple text, the response (output data) is generally JSON or XML. It does not provide service invocation criteria and service discovery criteria. You can write some simple instructions to users according to the characteristics of your service.
The way to get remote data is transitioning from Web services to the Web API.
The architecture of Web services is much more bloated than the Web API, and each of its requests needs to be encapsulated into XML and unpacked on the server. Therefore it is not easy to develop and eat more resources (memory, bandwidth). Performance is not as good as the Web API.
Web service vs. Web API