我应该使用Web API VS Web方法?方法、Web、API、VS

2023-09-04 02:47:43 作者:残影

我想了解网络API和有关Web方法的一些消息。我听说,我们应该停止使用网络的方法从几个来源。此外,为网络API的继任者,如果Web方法不应该再被使用?

解决方案

Web方法是ASMX技术的一部分。 ASMX是传统的技术,而不应被用于新的开发。 WCF或ASP.NET网络API应该被用于Web服务客户端和服务器的所有新的发展。一个提示:微软已经退休的 ASMX论坛 MSDN上

无论你使用WCF或ASP.NET的Web API将取决于您的需求。 WCF是更类似于Web方法,但更加丰富。的ASP.NET Web API,可以为您提供所有的HTTP协议的功能,如果你的API需要他们。

但在任何情况下,停止新的开发中使用Web方法。另外,我建议你问自己,为什么你不知道ASMX也换成了WCF大约八年前。还有什么你已经错过了在过去8年?还有什么可以采取你的企业你的竞争对手都已经消失了的地方?

I'm trying to understand web api and some news about web methods. I've heard that we should stop using web methods from a few sources. Additionally, is Web API the successor if web methods should no longer be used?

解决方案

Web methods are part of the ASMX technology. ASMX is a legacy technology, and should not be used for new development. WCF or ASP.NET Web API should be used for all new development of web service clients and servers. One hint: Microsoft has retired the ASMX Forum on MSDN.

创建Web API 帮助文档页面的两种方式

Whether you use WCF or the ASP.NET Web API will depend on your requirements. WCF is more similar to web methods, but far richer. ASP.NET Web API can provide you with all of the features of the HTTP protocol, if your API requires them.

But in any case, stop using Web Methods in new development. Also, I suggest you ask yourself why you didn't know that ASMX had been replaced by WCF about eight years ago. What else have you been missing out on in the past eight years? What else could have taken your business to places your competitors have already gone?