This is a migrated thread and some comments may be shown as answers.

Reporting Q3 2015 - "Method not allowed" - The requested resource does not support http method 'GET'.

4 Answers 568 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shannon
Top achievements
Rank 1
Shannon asked on 12 Nov 2015, 01:29 PM

Hi,

Following the directions at http://www.telerik.com/help/reporting/html5-report-viewer-embedding.html, the report border shows but the browser reports Method Not Allow for the page http://localhost:57012/api/reports/clients/231714-9deb/parameters.

When I browse to the page I get:

<Error>
<Message>
The requested resource does not support http method 'GET'.
</Message>
</Error>​

I have checked the posts:

 - http://www.telerik.com/forums/the-webapi-controller-action-for-clients-object-20object-parameters-404-(not-found)

and 

 - http://www.telerik.com/forums/reporting-html5-viewer---post-parameter-name-undefined#wVOaRf1DS0S5TILv4_DJ3g

 I have no Newtonsoft.Json in the GAC and I'm running the latest nuget version (Newtonsoft.Json.7.0.1).

 Any ideas how to fix?

 

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 16 Nov 2015, 05:09 PM
Hi Shannon,

Please check the Reporting REST service's settings and the handlers registrations added in the root's level web.config. All verbs used by the service must be allowed in the configuration - How To: Add Telerik Reporting REST Web API to Web Application (step 2).

In case the viewer and the service are hosted as separate applications, you will need to enable CORS for the service.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shannon
Top achievements
Rank 1
answered on 18 Nov 2015, 02:31 AM

Hi Stef,

 

Still no luck - I have followed the directions to the letter and have no crossdomain (CORS) issues.

I have a report controller pointing to a custom provider that looks like this:

public class ReportsController : ReportsControllerBase
    {
        static Telerik.Reporting.Services.ReportServiceConfiguration configurationInstance = new Telerik.Reporting.Services.ReportServiceConfiguration
        {
            HostAppId = "xxx",
            ReportResolver = new CustomReportResolver(),
            Storage = new Telerik.Reporting.Cache.File.FileStorage(),
        };

        public ReportsController()
        {
            this.ReportServiceConfiguration = configurationInstance;
        }
    }

Perhaps I am calling it from the client incorrectly?

 

$("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "https://xxx/api/reports/",
                templateUrl: 'https://xxx/ReportViewer/templates/telerikReportViewerTemplate-9.2.15.930.html',
                reportSource: {                    
                    report: getParameterByName("Id"),
                    parameters: {
                        CultureID: "en"
                    }
                }
            });

 

Note 'xxx' is replaced with my server name.  Same issue appears locally and remotely.

  

 

 

 

0
Shannon
Top achievements
Rank 1
answered on 18 Nov 2015, 02:33 AM

And the error has moved onto:

POST https://xxx/api/reports/clients/023224-ab16/parameters 404 (Not Found)

xxx/api/reports/clients/023224-ab16/instances:1 

POST https://xxx/api/reports/clients/023224-ab16/instances 404 (Not Found)

0
Stef
Telerik team
answered on 20 Nov 2015, 02:03 PM
Hello Shannon,

The errors still indicate the Reporting REST service is not reachable at the set address (viewer's serviceUrl).

Test if the Reporting REST service responds to requests by running the following URL in browser:
http://localhost:[portnumber]/api/reports/formats
Use the same URL (without /formats) for the viewer's serviceUrl. Change the URL to use HTTP or HTTPS depending on how the application is hosted and tested.

Also check the logic of the custom resolver and test replacing it with any of the default report resolvers, just to exclude the custom code as a source of the problem.
static ReportsController()
       {
           var appPath = HttpContext.Current.Server.MapPath("~/");
           var reportsPath = Path.Combine(appPath, @"..\..\..\Report Designer\Examples");
           var resolver = new ReportFileResolver(reportsPath)
               .AddFallbackResolver(new ReportTypeResolver());
 
           configurationInstance = new ReportServiceConfiguration
           {
               HostAppId = "Html5DemoApp",
               Storage = new FileStorage(),
               ReportResolver = resolver,
               ReportSharingTimeout = 0,
               ClientSessionTimeout = 15,
           };
       }
If the viewer is registered successfully and just displays yellow message box that the report cannot be resolved, it implies the error is in the custom resolver.


In order to investigate further the problem, please send us a demo project that reproduces the problem. For the purpose, you can use your support ticket on the same question.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Shannon
Top achievements
Rank 1
Answers by
Stef
Telerik team
Shannon
Top achievements
Rank 1
Share this question
or