I have an existing Asp.Net MVC Website and I would also like to provide a Web Service from the same domain.
What is the best way to approach creating a web service in this scenerio?
Do I add to this project or...?
ASP.NET MVC 5 for Beginners A web service is a web-based functionality accessed using the protocols of the web to be used by the web applications. There are three aspects of web service development: Creating the web service. Creating a proxy. Consuming the web service.
Asp.Net MVC is used to create web applications that return both views and data but Asp.Net Web API is used to create full-blown HTTP services with an easy and simple way that returns only data, not view.
ASP.NET enables you to create custom Web services or to use built-in application services, and to call these services from any client application. Basically web service is any piece of software that makes itself available over the Internet and uses a standardized XML messaging system.
You should be able to add an WebService file directly to the MVC project. Right click on solution and select add new item, then select the web category and att the bottom of the list there should be Web Service.
Just remember to check that the routes does not eat up the call to the webservice.
That way the webservice can get access to the same model classes as the MVC application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With