devlord
devlord

Reputation: 4164

Consuming ASP.NET Web API in C#

ASP.NET Web API seems to lack the service contract / data contract features of WCF web services which would have generated a wsdl that could be used to generate proxy classes. I'm wondering whether Web API is intended for consumption in a service-oriented architecture or if it's meant simply for Ajax consumption.

Upvotes: 0

Views: 1084

Answers (1)

Darren Reid
Darren Reid

Reputation: 2322

Web API (as far as I know) does not support WSDL generation. If you absolutely require a WSDL, WCF REST might be an option, though no longer supported.

Service-oriented architecture does not require the use of SOAP or reliance on a WSDL and RESTful services aren't restricted to being useful only for AJAX requests. There are quite a few RESTful web service client libraries available from nuget that makes interacting with these services easier. Though it might not be as simple as using code-gen, creating a library of POCO classes you can share with other C# clients also makes things easier. Hope that helps.

Upvotes: 1

Related Questions