[RESOLVED]how to create webservices in mvc 5?

hi all,

i am learning mvc 5.

i searched for web services in mvc 5 but i cant’t find proper resource

could any one please provide me step by step tutorial for web services in mvc 5.



You should look at Web API: http://www.asp.net/web-api

murali krishna14

i searched for web services in mvc 5 but i cant’t find proper resource

WebServices are just asmx fiule added to asp.net project( webforms or mvc)

Hi Mike,

Thanks for Reply

i have a doubt

is both web services and web-api are same?

or can we use webservices in webforms and web-api in mvc?

Web services are services delivered over HTTP. They can be Soap-based or REST-based. WCF and asmx files are examples of Soap-based web services frameworks. Web API is a REST-based framework for delivering services over the web. You can use Web API with Web
forms or MVC. You can also use WCF and Asmx files with Web Forms and MVC.

You have two major options when working with Web Services in ASP.NET. The older approach being Windows Communication Foundation (WCF) and the newer being Web API. I’ll include a few resources below detailing Getting Started with both technologies.

Windows Communication Foundation

Windows Communication Foundation (or WCF) is a one of Microsoft’s primary methods of handling web services within ASP.NET. I would recommend checking out the following resources :


ASP.NET Web API is a development environment aimed at developing RESTful Web Services that will allow your application to easily send and recieve HTTP Requests (web
) and perform operations based on the types of Requests that are made to it (such as providing information about a user if provided their ID etc.) It was designed to replace the previous Windows Communication Foundation
(WCF) approach to developing Web Serviecs within .NET.

You can learn more about it by visiting the Web API area of this site.

General Web Service Information

If you need some advice on using Web Services in ASP.NET, I would recommend the following resources : 

Hi murali krish,

Thanks for your post.

I agree with Mike.

WebApi is an alternative Service oriented application from Microsoft just like WCF. But WCF uses SOAP protocol and WebAPI uses HTTP protocol for communication.

So if you are using WCF to provide service for your MVC application you would host that wcf service seperately and consume its service by MVC application, EXACTLY same way you have to host your WebAPI project seperately and provide service to your Web application

More information:Add Web API to an existing MVC 5 Web Application

Hope this can be helpful.

Best Regards,


Thanks Mike and Rion,

Now i understood.

Leave a Reply