Job Descriptor when uploading via REST api
Posted on June 18, 2013 at 7:07pm
I'm currently trying to schedule a job using the REST api for Jasper Server 5.1 (community and pro) and as a result of uploading what appears to be a valid job descriptor:
<job>
<baseOutputFilename>AllAccounts</baseOutputFilename>
<description>sample</description>
<label>sample</label>
<outputFormats>PDF</outputFormats>
<outputLocale></outputLocale>
<parameters>
<name>REPORT_TIME_ZONE</name>
</parameters>
<repositoryDestination>
<folderURI>/public/Samples/Reports</folderURI>
<outputDescription></outputDescription>
<overwriteFiles>false</overwriteFiles>
<sequentialFilenames>false</sequentialFilenames>
<version>0</version>
</repositoryDestination>
<simpleTrigger>
<startDate>2013-06-19T07:29:52+10:00</startDate>
<timezone>Australia/Sydney</timezone>
<version>0</version>
<occurrenceCount>1</occurrenceCount>
</simpleTrigger>
<version>0</version>
</job>
Performing a PUT ( scheduling a new job) or downloading a manually scheduled job descriptor and performing a POST to the jasperserver-pro/rest/job/ endpoint, results in the following 400 bad request message:
please check the request job descriptor
Because the JAXB conversion is surpressing the error message I'm unable to see what is wrong with my job descriptor being uploaded. As mentioned I've tried creating a job descriptor identified in
http://community.jaspersoft.com/sites/default/files/docs/jasperreports-s... as well as downloading an existing scheduled job and just reuploading in the manner described in the web service guide and both result in the same error. Require assistance in identifying what I'm doing wrong.
Joined: Apr 25 2012 - 4:36pm
Last seen: 9 years 7 months ago
Posted on September 16, 2013 at 11:47am
I don't see a source seciont in your job descriptor. In this section you indicate the uri from the report source, as well as any parameters you want to pass to the server:
<source><reportUnitURI>/path/to/report</reportUnitURI><parameters><entry><key>PARAM_KEY</key><value>PARAM_VALUE</value></entry></parameters></source>
Joined: Apr 20 2012 - 3:51am
Last seen: 6 years 1 month ago
Posted on April 4, 2018 at 5:13am
Hello, In your xml descriptor file you haven't specified the source resource URI and output format should be added with in one more tag. I have tried the below xml and it worked for me.
<job>
<baseOutputFilename>AllAccounts</baseOutputFilename>
<description>sample</description>
<label>sample</label>
<outputFormats><outputFormat>HTML</outputFormat></outputFormats>
<outputLocale></outputLocale>
<source><reportUnitURI>/public/Samples/Reports/13g.TopFivesReport</reportUnitURI></source>
<repositoryDestination>
<folderURI>/public/Samples/Reports</folderURI>
<outputDescription></outputDescription>
<overwriteFiles>false</overwriteFiles>
<sequentialFilenames>false</sequentialFilenames>
<version>0</version>
</repositoryDestination>
<simpleTrigger>
<startDate>2018-04-04T17:28:03.598+05:30</startDate>
<timezone>Asia/Calcutta</timezone>
<version>0</version>
<occurrenceCount>1</occurrenceCount>
</simpleTrigger>
<version>0</version>
</job>
Joined: Feb 13 2018 - 9:20pm
Last seen: 1 year 5 months ago
Hello, In your xml descriptor file you haven't specified the source resource URI and output format should be added with in one more tag. I have tried the below xml and it worked for me.
<job>
<baseOutputFilename>AllAccounts</baseOutputFilename>
<description>sample</description>
<label>sample</label>
<outputFormats><outputFormat>HTML</outputFormat></outputFormats>
<outputLocale></outputLocale>
<source><reportUnitURI>/public/Samples/Reports/13g.TopFivesReport</reportUnitURI></source>
<repositoryDestination>
<folderURI>/public/Samples/Reports</folderURI>
<outputDescription></outputDescription>
<overwriteFiles>false</overwriteFiles>
<sequentialFilenames>false</sequentialFilenames>
<version>0</version>
</repositoryDestination>
<simpleTrigger>
<startDate>2018-04-04T17:28:03.598+05:30</startDate>
<timezone>Asia/Calcutta</timezone>
<version>0</version>
<occurrenceCount>1</occurrenceCount>
</simpleTrigger>
<version>0</version>
</job>