Jump to content
We've recently updated our Privacy Statement, available here ×

Using rest ws to run a report from Java


jazzman

Recommended Posts

I'm trying to run a report on jasper server 4.2.1 from java using rest webservice (HttpComponents) and I get:
 
"Invalid resource descriptor"
 
I've attached the code trying to do the put method to get the uuid. Is there something I'm ommiting? From Web Services guide - there's stuff about a "resource descriptor of type reportUnit" that must be included but I can't make sense of what that means. Does anyone know where I'm going wrong? Also is this the best way to run a pdf report from java using REST?
Code:


Post Edited by jazzman at 01/09/2012 20:16
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This is how i did it, mind you the code below is code for the play framework, so some methods like the WS.* methods are play framework specific.

First I use the login method, to get a jsession if from the jasperserver. This jsessionid is in our case put in a global String, and added to the headers of all following requests.
Then I run the runReport method with the URI to the report, and the outputformat I want. This returns an xml, wich I parse in the fetchReport method. This method finally
downloads the report I requested.

Hope this helps.

 

Regards,

Peter
 

Code:


Post Edited by waalp at 01/10/2012 11:07
Link to comment
Share on other sites

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...