什么是一个Web API和Web服务之间的区别? [英] What is the difference between a web API and a web service?

查看:217
本文介绍了什么是一个Web API和Web服务之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个网络API之间的差异 Web服务?或者,他们是同一个?

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

推荐答案

Web服务通常提供 WSDL 从中您可以自动创建客户存根。 Web服务是基于 SOAP协议
网络API是一个较新的Microsoft框架,它可以帮助您构建基于 REST接口。响应可以是JSON或XML,但是没有办法自动生成的客户端,因为Web API不提供像Web服务的WSDL服务描述。
因此,它取决于对技术之一,你要使用的您的要求。甚至
WCF 符合您的要求好,只是看在MSDN文档。

A web service typically offers a WSDL from which you can create client stubs automatically. Web Services are based on the SOAP protocol. 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.

这篇关于什么是一个Web API和Web服务之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆