I am new in using jasper reort server.
I have created a report template and deploy it to jasper report server.
Now i want to call this report from my asp.net web application using REST API.
With the help of one forum i have written following code:
The remote server returned an error: (405) Method Not Allowed.
// Send PUT, the requestAllResult contains the above <report>...
Line 34: Line 35: string requestAllResult = httpClient.UploadString("http://localhost:8080/jasperserver/rest/resources/reports/samples/testreport?RUN_OUTPUT_FORMAT=PDF", "PUT", requestXml); Line 36: Line 37: // Extract uuid and file
Please help to tell where i am doing wrong.
You need to call the REPORTS method not the RESOURCE Method to execute the report. Check the Jasper Server Web Services Guide.
In RESTv1 that will look like this:
So in your case your code should look like this:
string requestAllResult = httpClient.UploadString("http://localhost:8080/jasperserver/rest/report/reports/samples/testreport?RUN_OUTPUT_FORMAT=PDF", "PUT", requestXml);
That is assuming your report URI is "/reports/samples/testreport". Also remember that to be able to issue REST requests you need to pass authentication to JRS (see REST Login Service).
Also consider using the REST_v2 APi that allows you to generate the report executions asynchronously.