Restful webservice get jrprint encounter 404 error

Hi there,

I wanna get JasperPrint object from jasperreport server  via RESTful webservice,

following jasperreports-server-web-service-guide.pdf

Method URL
GET
http://:/jasperserver[-pro]/rest_v2/reports/path/to/report.?
where is one of the following: html, pdf, xls, rtf, csv, xml, jrprint

Then view this report in jasperreports flash viewer.

I spent a lot of time on Google, Some people also encounter same problem with me, but no body can find solution.

I am using Jasperreport Server 5.0.0 COMMUNITY EDITION.

here is my codes, 

Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter("jasperadmin","jasperadmin"));
// For the url, if I use other format it works. but only 'jrprint' doesn't work.
WebResource r = client.resource(url);
JasperPrint jasperPrint = (JasperPrint)r.get(InputStream.class);

when I use 'jrprint' format, throw errors as below:

 

com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8899/jasperserver/rest_v2/reports/reports/samples/AllAc... returned a response status of 404 Not Found
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
at org.jfeng.com.report.ReportJerseyClient.runReportAsJRPrint(ReportJerseyClient.java:65)
at org.jfeng.com.action.DefaultAction.showReportContent(DefaultAction.java:1295)

 

syrinsoft's picture
Joined: Dec 7 2011 - 8:09am
Last seen: 8 years 11 months ago

2 Answers:

Found this within the community.  Is this a possibility?

http://community.jaspersoft.com/questions/543049/jrprint-output-format-t... 

Dale

dbooth's picture
415
Joined: Aug 23 2011 - 7:56am
Last seen: 2 weeks 2 days ago

in that post, he did 2 things.

First, use "put" method generate a report then use "get" method download report as JasperReport Object.

Can I only use get method both can generate report and export it. 

for PDF format seems can only use get method obtain the data.

PS. is rest_v2 only for jasperreport-server 5.0.0 ? if it's ture. maybe rest_v2 Running a report for jasperprint format got a issue.

syrinsoft's picture
Joined: Dec 7 2011 - 8:09am
Last seen: 8 years 11 months ago

Any solution?

su.man - 10 years 1 week ago
Feedback