markmnl
markmnl

Reputation: 11426

Adding Web Service to an existing ASP .NET MVC 3 site

Scenario

What are my options?

I have read: Xamarin's Web Services introduction. It seems my options are:

I am leaning toward the first two as they do not require a separate service, however I am wonder about the authentication - I guess would have to use Basic Authentication (obviously over TLS) and manually manage the session to authenticate clients?

UPDATE I I read WCF is now favoured over ASP .NET Web Services since .NET 4.0.

UPDATE II I can host my WCF side-by-side with my ASP.NET MVC site in IIS just by adding the service to my web project. Still unsure about whether they can share authentication.

UPDATE III I see now the new way to host a HTTP API is using a ASP .NET Web API - this is just an ASP application. :)

Upvotes: 1

Views: 1003

Answers (1)

Liviu Mandras
Liviu Mandras

Reputation: 6617

I would recommend using Asp.NET WebApi. Why?

  • you have external clients like mobile apps, especially those that are outside the Microsoft stack
  • your operations required are mostly CRUD which allows you to create a nice RESTful API
  • HTTP protocol and the JSON format will give you the highest degree of interoperability (I understand you are using Xamarin but there is a risk that the framemork might not give you what you want at some point and if you need to give it up, you won't have any problems with regards to the web services

Upvotes: 1

Related Questions