Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting WCF Services in ASP.NET MVC Web Application

I have an ASP.NET MVC 1.0 webapp, which serves as a front-end site for our external API. More specifically, it has a Control Panel for our API clients, documentation, etc.

Now I want to move our actual API (which is a set of WCF services) inside this project, so that, for example, http://api.example.com/controlpanel/dashboard would be served by ASP.NET MVC runtime, wherease http://api.example.com/services/1.0/users.svc would be served by an appropriate WCF service.

Granted, this can be done by adding a services/1.0 virtual folder in IIS, but I really want these two parts to be inside one project.

Is this doable at all? If yes, how do I integrate these two beasts?

like image 351
Anton Gogolev Avatar asked Mar 17 '10 13:03

Anton Gogolev


1 Answers

Turns out MVC/WCF isn't the issue. Services hosted within the MVC app are activated just fine (I guess IIS bypasses the MVC runtime for .svc requests).

The issue was more to do with services in Areas, and requests for .svc files not going through the route table.

I've asked a more specific question addressing the actual problem here.

Expose WCF services that belong to an Area in MVC app at a routed path

like image 178
Michael Shimmins Avatar answered Sep 19 '22 00:09

Michael Shimmins