且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我们不能添加一个Web API作为"服务引用"在Visual Studio中,我们可以以同样的方式与WCF或ASMX?

更新时间:2022-05-12 08:34:55

你的意思是一个休息Web服务?休息,没有服务定义页面,就像WCF或ASMX。通常人们想使用一个JSON REST API ..但是..如果你只是寻找一个JSON输出,你想你的客户迅速地将能够连接到你的服务,你应该考虑的OData。这真的很容易创建和它使大量客户端语言,你的数据层进行访问。他们有移植一吨的语言的OData客户端库。提交的答案,按要求。 :)

Do you mean a Rest Web Service? With Rest, there is no service definition page, like with WCF or ASMX. Usually people want to use a Rest API with JSON.. however.. if you are just looking for a JSON output, and you want your clients to quickly be able to connect to your service, you should consider OData. It's really easy to create and it makes your data layer accessible for a large number of client languages. They have the OData client library ported for a ton of languages. Submitted as an answer, as requested. : )