How to create a RESTful web service in asp.net?

I just want to create a pretty basic REST service so that I can show some data in my asp.net/SQL server application for external work, for example this .....

http://domain.com/api/offices - will return a set of xml office spaces. http://domain.com/api/offices/15 - will return all the details of the office 15.

All this is pretty standard stuff (including basic authentication), but there seem to be several ways to achieve this using Microsoft technologies, and I don't know where to start. These seem to be options ...

1) WCF

2) ASP.NET MVC

3) ADO.NET Data Services

4) Rest Starter Kit project templates?

Which one is the easiest and most “latest” solution for creating a web service?

+3
source share
3 answers

If you do not plan to add any other endpoints in the future (for example, SOAP, etc.) and the service will not be used by the Silverlight client, I would suggest using ASP.NET MVC.

If you are using Silverlight, use ADO.NET Data Services.

If you plan to create a reliable service structure with several types of endpoints, use WCF.

+2
source

There are several alternatives, not sure if you have heard of them, but you could also study them:

  • Open Rasta , - -, , ; , , , Rest ( .net, ), , asp.net, , HTML, JSON , ,

  • , , - Siesta, Asp.NET mvc

Wcf ...

,

+2

ADO.NET Data Services WCF, , . ( , , ). - , , , .NET(PHP, Java).

+1
source

Source: https://habr.com/ru/post/1742849/


All Articles