Is there any difference between a web API and a web service ? Or are they one and the same ?
相关问题
- Register MicroServices in Azure Active Directory (
- PromptDialog Choice with List object Bot Framework
- Dotnet Core API - Get the URL of a controller meth
- Serving data with “transfer-encoding: chunked” on
- Is the Namespace for a SOAP Web Service case sensi
相关文章
- Using JAX-WS 2.2.5 client with JDK/JRE 1.5
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- How to create base64Binary data?
- POSTing data to WebApi after update to 5.1.0 fails
- Can you use generic methods in a controller?
- Are there any public UDDI registries available?
- Remove a route with IOperationFilter in SwashBuckl
- REST search interface and the idempotency of GET
All WebServices is API but all API is not WebServices, API which is exposed on Web is called web services.
Difference between Web Service and Web API nicely explained here:
https://softwareengineering.stackexchange.com/questions/38691/difference-between-web-api-and-web-service
Text from the link:
Web Services - that's standard defined by W3C, so they can be accessed semi-automatically or automatically (WSDL / UDDI). The whole thing is based on XML, so anyone can call it. And every aspect of the service is very well defined. There's parameters description standard, parameter passing standard, response standard, discovery standard, etc. etc. You could probably write 2000 pages book that'd describe the standard. There are even some "additional" standards for doing "standard" things, like authentication.
Despite the fact that automatic invoking and discovery is barely working because clients are rather poor, and you have no real guarantee that any service can be called from any client.
Web API is typically done as HTTP/REST, nothing is defined, output can be for eg. JSON/XML, input can be XML/JSON/or plain data. There are no standards for anything => no automatic calling and discovery. You can provide some description in text file or PDF, you can return the data in Windows-1250 instead of unicode, etc. For describing the standard it'd be 2 pages brochure with some simple info and you'll define everything else.
Web is switching towards Web API / REST. Web Services are really no better than Web API. Very complicated to develop and they eat much more resources (bandwidth and RAM)... and because of all data conversions (REQUEST->XML->DATA->RESPONSE->XML->VALIDATION->CONVERSION->DATA) are very slow.
Eg. In WebAPI you can pack the data, send it compressed and un-compress+un-pack on the client. In SOAP you could only compress HTML request.
In the context of ASP.Net a Web API is a Controller whose base class is ApiController and does not use Views. A Web Service is a class derived from WebService and has automatic WSDL generation. By default it is a SOAP api, but you can also use JSON by adding a ScriptServiceAttribute.
A Web Service if you want is a Web API. Specifically Web API usually means RESTful (HTTP based) web service and Web Service usually means SOAP+WSDL (+HTTP or SMTP or JMS..).
Tipically RESTful web services are opposed to Web Services (WSDL,SOAP) but recently it has been introduced the term RESTful Web services (with uppercase 'W') that means RESTful+WSDL+SOAP..
Check out this chart for differences among the three concepts: http://www2.mokabyte.it/cms/figureproviderservlet?figureId=IUS-6NS-OBV_7f000001_19624184_5621ef4e--Fig02.jpg
Hope it helps!
API vs Web Service
Just pasted the summary of the linked article:
Read more: Difference Between API and Web Service | Difference Between | API vs Web Service http://www.differencebetween.net/technology/internet/difference-between-api-and-web-service/#ixzz3e3WxplAv
See the above link for the complete answer.
Two things are very simple to understand,
Note: All Web Service is API's but not all API' is web services