I have a basic MVC web application complete with a Web API that I'm attempting to use to run an existing SSRS report and save those results to a file. I'm following the example I found here but whenever I attempt to add the line "Using System.Web.Services;" I'm given the following error message: "The type or namespace 'Services' does not exist in the namespace System.Web." Do I need to add something to my project to reference System.Web.Services? I have to have System.Web.Services in order to use the ReportExecutionService.
Here's the code:
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Routing;
using System.Web;
using System.Web.Services;
namespace TestAPI.Controllers
{
public class PrintController : ApiController
{
[Authorize]
[Route("api/PrintFile")]
[HttpGet]
public HttpResponseMessage PrintReport()
{
HttpResponseMessage returnValue = new
HttpResponseMessage(HttpStatusCode.OK);
if (returnValue.StatusCode == HttpStatusCode.OK)
{
ReportExecutionService rs = new ReportExecutionService();
}
return returnValue;
}
}
}