SOAP Schedule request - java.lang.NumberFormatException: Invalid date/time

0

Hi

Jasper server 4.7.1 comercial, Oracle 11g, on Windows 7

I am trying to schedule a job using SOAP.  I have copied the example from the JasperReports-Server-Web-Services_guide with a couple of modifications.  I am running it from SoapUI but I always get the same error whatever I do. The returned error is:-

java.lang.NumberFormatException: Invalid date/time

I did wonder if this was a local issue so I ran getAllJobs and copied a return date from it (Note: this is the only service I have managed to make work!!!) but it is teh same as the one I am using.

The date format in use is:- 

2013-02-20T23:00:00.000Z

I have even wondered if there is a tag I am missing?

XML SOAP request included as attactment.

Cheers

Bob

 

gillett.bob's picture
Joined: Dec 20 2012 - 6:04am
Last seen: 6 years 7 months ago
I just tried to download and look at my example and it failed, so I am posting the code here:- /organizations/organization_1/performance/reports/sqlFrequency Description 32013-02-20T23:00:00.000Z1Sales3PDF/organizations/organization_1/performance/reportsfalsefalse
gillett.bob - 6 years 9 months ago

2 Answers:

0

Faced the same issue today. You need to use start date along with timezone (which should not be null and is to be set  explicitly if startDate is specified). Or just omit timezone, start and end dates.

stasal's picture
2
Joined: Aug 14 2012 - 7:55am
Last seen: 2 years 3 weeks ago

Thanks for the reply, but I still cannot make it work. I've tried adding a timezone from another JS example:- <timezone xsi:type="xsd:string">Europe/Minsk</timezone>
I've tried setting the start time to nil and I've tried removing the simpletrigger, now of which results in a success!

Any chance you could publish here the soap message that worked for you please?

Thanks

Bob

gillett.bob - 6 years 9 months ago

Sure, this code works for me: http://pastebin.com/8C1i2EHW where reportUnitName is a valid report unit URI. Or, this version: http://pastebin.com/DmuHAv7F with timezone, start and end dates skipped works just fine too

stasal - 6 years 9 months ago
0

It seems it is actually that the server does not like fields set to nil, by commenting out several lines we got the thing to work.  Below is the example I ran in SOAP UI, so if you are stuck try this!

Bob

 

<?xml version="1.0" encoding="UTF-8"?>
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
 
XMLSchema-instance">
 
<soapenv:Body>
 
<ns1:scheduleJob soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.jasperforge.org/jasperserver/ws">
 
<job xsi:type="ns1:Job">
 
<reportUnitURI xsi:type="xsd:string">/organizations/organization_1/performance/reports/sqlFrequency</reportUnitURI>
 
<username xsi:type="xsd:string" xsi:nil="true"/>
 
<label xsi:type="xsd:string">Label 5</label>
 
<description xsi:type="xsd:string">Description 4</description>
 
<simpleTrigger xsi:type="ns1:JobSimpleTrigger">
 
<!--timezone xsi:type="xsd:string">Europe/Amsterdam</timezone-->
 
<!--startDate xsi:type="xsd:dateTime">2022-05-30T09:30:10.5</startDate-->
 
<!--endDate xsi:type="xsd:dateTime" xsi:nil="true"/-->
 
<occurrenceCount xsi:type="xsd:int">1</occurrenceCount>
 
<!--recurrenceInterval xsi:type="xsd:int">1</recurrenceInterval-->
 
<!--recurrenceIntervalUnit xsi:type="ns1:IntervalUnit">DAY</recurrenceIntervalUnit-->
 
</simpleTrigger>
 
<!--calendarTrigger xsi:type="ns1:JobCalendarTrigger" xsi:nil="true"/-->
 
<!--parameters xsi:type="ns1:parameters " xsi:nil="true"/-->
 
<baseOutputFilename xsi:type="xsd:string">Sales7</baseOutputFilename>
 
<outputFormats soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
 
<outputFormats xsi:type="xsd:string">PDF</outputFormats>
 
</outputFormats>
 
<!--outputLocale xsi:type="xsd:string">en_GB</outputLocale-->
 
<repositoryDestination xsi:type="ns1:JobRepositoryDestination">
 
<folderURI xsi:type="xsd:string">/organizations/organization_1/performance/reports</folderURI>
 
<sequentialFilenames xsi:type="xsd:boolean">true</sequentialFilenames>
 
<overwriteFiles xsi:type="xsd:boolean">true</overwriteFiles>
 
</repositoryDestination>
 
<!--mailNotification xsi:type="ns1:JobMailNotification" xsi:nil="true"/-->
 
</job>
 
</ns1:scheduleJob>
 
</soapenv:Body>
 
</soapenv:Envelope>
 
gillett.bob's picture
Joined: Dec 20 2012 - 6:04am
Last seen: 6 years 7 months ago
Feedback
randomness