Why can't we add a Web API as a “service reference” in Visual Studio the same way we can with WCF or ASMX?

前端 未结 4 1914
忘掉有多难
忘掉有多难 2020-12-14 15:41

I\'ve decided to use Web API (as a middle tier) for an app I\'m developing, but can\'t seem to figure out how to \"tie it in\" to the front end (front end being an ASP.NET M

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 16:25

    why doesn't a Web API support being added as a reference the same way a WCF or ASMX is added

    WCF or ASMX-based web services are SOAP-based and there typically is an associated WSDL. WSDL allows tooling to be built around to generate proxy classes and all that but ASP.NET Web API is meant to build REST (or HTTP based) services and there is no meta data in the form of WSDL or anything similar and hence adding service reference through VS is not applicable for ASP.NET Web API. WADL (Web Application Description Language) is supposed to be the WSDL for REST but that spec went no where.

提交回复
热议问题