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

csaurav80

Members
  • Posts

    4
  • Joined

  • Last visited

csaurav80's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I am trying to create a new user by jasper rest user service api. But I always get 400 bad request and this is what, I am trying. Can anyone point me what I am doing wrong ? curl -i -u jasperadmin:jasperadmin -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{"username":"mynewuser","password":"mynewuser","fullName":"NEWUSER":"emailAddress:"user_1@test.com"}' "http://localhost:8080/jasperserver/rest/user/" HTTP/1.1 400 Bad Request Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 05:30:00 GMT+05:30 P3P: CP="ALL" Set-Cookie: JSESSIONID=F7394A9F7348C22E4B264FBCEB6B828F; Path=/jasperserver Content-Type: text/html;charset=UTF-8 Content-Length: 971 Date: Mon, 02 Sep 2013 10:32:21 GMT Connection: close
  2. I am trying to create a new user by jasper rest user service api. But I always get 400 bad request and this is what, I am trying. Can anyone point me what I am doing wrong ? curl -i -u jasperadmin:jasperadmin -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{"username":"mynewuser","password":"mynewuser","fullName":"NEWUSER":"emailAddress:"user_1@test.com"}' "http://localhost:8080/jasperserver/rest/user/" HTTP/1.1 400 Bad Request Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 05:30:00 GMT+05:30 P3P: CP="ALL" Set-Cookie: JSESSIONID=F7394A9F7348C22E4B264FBCEB6B828F; Path=/jasperserver Content-Type: text/html;charset=UTF-8 Content-Length: 971 Date: Mon, 02 Sep 2013 10:32:21 GMT Connection: close
  3. Hi, I am consuming Webservice call in Jasper Reports particulary the ones where you can download reports asynchronously using the "v2/reportExecutions" Service. I am using the Login web service provided by jasper reports where after executing the login service, the response returns a session in cookie which can be further used to make other REST api calls. The problem, I am currently facing is, that the session seems to expire after every 5 or 10 minutes and when i try to make subsequent REST api calls to other services, i get 404 error. I am using RestClient gem for making the request and I have provided the code samples below. Anybody has any idea, what i am doing wrong ? This is how I making the call to the login service response = RestClient.post "http://some-path.com/jasperserver-pro/rest/login", {:j_username => 'some_username', :j_password => 'password'} Output of response.cookies is {"JSESSIONID"=>"4FCA35A6817C323DFD6BC6B33CDDD36E", "Path"=>"%2Fjasperserver-pro"} Now, I store this response.cookies in as a JSON object and keep on making subsequent calls for downloading the reports. For example This call is for Running a Report Asynchronously RestClient.post "https://some-path.com/jasperserver-pro/rest_v2/reportExecutions", "{"reportUnitUri":"/some_path","async":true,"freshData":false,"saveDataSnapshot":false,"outputFormat":"pdf","interactive":true,"ignorePagination":false,"parameters":{"reportParameter":[{"name":"PROJECT_NAMES","value":["Name","OB24"]},{"name":"STATUS","value":["Active","Inactive"]},{"name":"MATERIAL","value":["false","true"]},{"name":"REPORT_TITLE","value":["Current Total RRR by Category "]},{"name":"USER_NAME","value":["CGR User"]},{"name":"CUSTOM_TYPES","value":["Threat",""]},{"name":"TABLE_NAME","value":["joined_risks_projects"]},{"name":"START_DATE","value":["2013-08-23T03:51:00Z"]},{"name":"END_DATE","value":["2013-08-23T03:51:00Z"]}]}}", {:cookies=>{"JSESSIONID"=>"4FCA35A6817C323DFD6BC6B33CDDD36E", "Path"=>"%2Fjasperserver-pro"}, :content_type=>:json, :accept=>:json} and this is the call for REST API call for Polling the status of the report RestClient.get "https://some-path.com/jasperserver-pro/rest_v2/reportExecutions/1475850202_1377843127488_2451/status", {:cookies=>{"JSESSIONID"=>"4FCA35A6817C323DFD6BC6B33CDDD36E", "Path"=>"%2Fjasperserver-pro"}, :content_type=>:json, :accept=>:json} where 1475850202_1377843127488_2451 is the request_id which i have got from the above API call. or even If i want to get the report output with the call given below. RestClient.get "https://some-path.com/jasperserver-pro/rest_v2/reportExecutions/1475850202_1377843127488_2451/exports/exportID/outputResource", {:cookies=>{"JSESSIONID"=>"4FCA35A6817C323DFD6BC6B33CDDD36E", "Path"=>"%2Fjasperserver-pro"}, :content_type=>:json, :accept=>:json} I always get this error: RestClient::ResourceNotFound: 404 Resource Not Found. Please note that, I get this error only after 5 or 10 mins.Not before that. Where am I doing wrong or is this how consuming of Jasper Report webservice will work ? I read in the docs, that Jasper Architecture creates the session and we can use this session for subsequent calls. Hoping to get clarified soon. I am using Ruby 1.9.2, Rails 3 and RestClient gem. Thanks !
×
×
  • Create New...