Jump to content
Changes to the Jaspersoft community edition download ×

Restful webservice get jrprint encounter 404 error


yinjianfeng

Recommended Posts

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/AllAccounts.jrprint 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)

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...