Telerik Reporting Q3 2013 version 7.2.13.1016 - Web Api call returns [Error registering the viewer with the service] error

StackOverflow https://stackoverflow.com/questions/20058871

  •  31-07-2022
  •  | 
  •  

Question

Telerik Reporting Q3 2013 version 7.2.13.1016

I followed [REST Service Host on IIS] and tried to call reports by HTML5 Report Viewer, I get "Error registering the viewer with the service" error.

Simply everything works fine when I have viewer in the same MVC project which contains Reports controller, but if I move the viewer page to another project and change the serviceUrl to [http://localhost:?????/api/reports/] instead of [api/reports/] I do get the error.

I can see the [Get http://localhost:?????/api/reports/] in fiddler is successful but Viewer gets the above error.

Wondering if anybody has experience on this issue

The whole purpose is hosting Web Api on IIS and having Telerik HTML5 Report Viewer (or MVC wrapped version) calling the hosted Web Api service.

Was it helpful?

Solution

Ajax Call from Telerik Report Viewer to pass requests to WebApi Service which is hosted in another server causes cross origin requests, AJAX in Web Applications uses the XmlHttp object which by default doesn't allow access to remote domains.

Enabling Cross-Origin Requests in ASP.NET Web API tries to solve the matter: http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#enable-cors

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top