How to host a web service in MVC3?

How can I use web service in mvc3? Where should I enable the web service? Totally new to this ... Help please.

+4
source share
3 answers

In recent versions of VS, you can click here:
alt text

In the window that opens, you can enter the service address and perform the required configuration.

You can place links to services in any project. Id suggests creating a separate project and keeping them there.

+3
source

They made it difficult to find additional Web Reference features in later versions of VS, it seems they tried to force us to use fully running WCF services instead ... But you can still do it.

Right-click the Service References folder and select Add a new Reference , then click Advanced , and then add another button to add the web service to this window.

+2
source

I support the Open Source ServiceStack web service infrastructure , which has NuGet MVC PowerPack , allowing you to trivially add web service functionality to any MVC web application.

From the outside, without any settings or code, ServiceStack automatically provides REST XML, JSON, JSV, CSV and SOAP services. Here are a few demos that show how easy it is to create web services with only C # (and no configuration):

Edit Added Version MV3 + ServiceStack

SocialBootstrapApi Demo project is a functional site MVC3 + ServiceStack + Twitter Bootstrap + Backbone SPA, which also has a live copy of the repo deployed to AppHarbor at: http://bootstrapapi.apphb.com

+1
source

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


All Articles