Jump to content

gwhitaker

Recommended Posts

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>
        <value xsi:type='xs:string' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>Australia/Sydney</value>
    </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-server-web-services-guide_1.pdf 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.
Link to comment
Share on other sites

  • 2 months later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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>[/code]

 

Link to comment
Share on other sites

  • 4 years later...

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>

Link to comment
Share on other sites

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>

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