What is the difference between a web API and a web

2019-01-12 17:18发布

Is there any difference between a web API and a web service ? Or are they one and the same ?

11条回答
唯我独甜
2楼-- · 2019-01-12 17:37

Web service is absolutely the same as Web API - just a bit more restricted in terms of underlying data format. Both use HTTP protocol and both allows to create RESTful services. And don't forget for other protocols like JSON-RPC - maybe they fit better.

查看更多
趁早两清
3楼-- · 2019-01-12 17:38

for more detail visit this link Diagram

查看更多
在下西门庆
4楼-- · 2019-01-12 17:44

Well, TMK may be right in the Microsoft world, but in world of all software including Java/Python/etc, I believe that there is no difference. They're the same thing.

查看更多
一纸荒年 Trace。
5楼-- · 2019-01-12 17:51

A web service typically offers a WSDL from which you can create client stubs automatically. Web Services are based on the SOAP protocol. ASP.NET Web API is a newer Microsoft framework which helps you to build REST based interfaces. The response can be either JSON or XML, but there is no way to generate clients automatically because Web API does not offer a service description like the WSDL from Web Services. So it depends on your requirements which one of the techniques you want to use. Perhaps even WCF fits your requirements better, just look at the MSDN documentation.

查看更多
Ridiculous、
6楼-- · 2019-01-12 17:53

The basic difference between Web Services and Web APIs

Web Service:

1) It is a SOAP-based service and returns data as XML.

2) It only supports the HTTP protocol.

3) It is not open source but can be used by any client that understands XML.

5) It requires a SOAP protocol to receive and send data over the network, so it is not a light-weight architecture.

Web API:

1) A Web API is an HTTP based service and returns JSON or XML data by default.

2) It supports the HTTP protocol.

3) It can be hosted within an application or IIS.

4) It is open source and it can be used by any client that understands JSON or XML.

5) It is light-weight architectured and good for devices which have limited bandwidth, like mobile devices.

查看更多
登录 后发表回答