Jump to content
Changes to the Jaspersoft community edition download ×

Scheduling reports via web services


Recommended Posts



I am trying to use scheduling web service provided by jasper server 2.1 from my PHP application.


How can i know what parameters does a method(operation) needs and in what format?

i.e. If i want to use operation 'scheduleJob' then what all parameters will be passed to the Pear Soap client's call method. And as it takes an array, in what format?


Any help in this regard would be much appreciated.

Post edited by: vjregister, at: 2007/12/25 09:15

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Here is the code i used -


$connection_params['user'] = $username;

$connection_params['pass'] = $password;

$ns = 'http://www.jasperforge.org/jasperserver/ws';



$soap = new SOAP_client($wsdl, false, false, $connection_params);


$response = $soap->call('scheduleJob',$params,array('namespace' => $ns));


I tried sending the $params in the following 2 ways(i.e. as an array or XML) -


$params = array('job'=> array( 'reportUnitURI'=> '/reports/samples/ SalesByMonth','label' => 'label 3','description'=>'naspite','simpleTrigger'=> array('startDate'=>'2008-10-09T09:25:00.000Z', 'occurrenceCount'=>'1'), 'parameters'=>array('TextInput'=>'22', 'ListInput'=>'2', 'CheckboxInput'=>'true'), 'baseOutputFilename'=>'Sales3', 'outputFormats'=>'PDF', 'repositoryDestination'=>array('folderURI'=>'/ContentFiles', 'sequentialFilenames'=>'false', 'overwriteFiles'=>'false')));



$params = array("request" => $op_xml );

where, $op_xml = <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">/reports/samples/SalesByMonth</reportUnitURI>

<username xsi:type="xsd:string" xsi:nil="true"/>

<label xsi:type="xsd:string">Label 3</label>

<description xsi:type="xsd:string">Description 3</description>

<simpleTrigger xsi:type="ns1:JobSimpleTrigger">

<timezone xsi:type="xsd:string" xsi:nil="true"/>

<startDate xsi:type="xsd:dateTime">2008-10-09T09:25:00.000Z</startDate>

<endDate xsi:type="xsd:dateTime" xsi:nil="true"/>

<occurrenceCount xsi:type="xsd:int">1</occurrenceCount>

<recurrenceInterval xsi:type="xsd:int" xsi:nil="true"/>

<recurrenceIntervalUnit xsi:type="ns1:IntervalUnit" xsi:nil="true"/>


<calendarTrigger xsi:type="ns1:JobCalendarTrigger" xsi:nil="true"/>

<parameters soapenc:arrayType="ns1:JobParameter[4]" xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/ encoding/">

<parameters xsi:type="ns1:JobParameter">

<name xsi:type="xsd:string">TextInput</name>

<value xsi:type="soapenc:int">22</value>


<parameters xsi:type="ns1:JobParameter">

<name xsi:type="xsd:string">CheckboxInput</name>

<value xsi:type="soapenc:boolean">true</value>


<parameters xsi:type="ns1:JobParameter">

<name xsi:type="xsd:string">ListInput</name>

<value xsi:type="soapenc:string">2</value>


<parameters xsi:type="ns1:JobParameter">

<name xsi:type="xsd:string">DateInput</name>

<value xsi:type="xsd:dateTime">2007-10-09T09:00:00.000Z</value>



<baseOutputFilename xsi:type="xsd:string">Sales3</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>


<outputLocale xsi:type="xsd:string" xsi:nil="true"/>

<repositoryDestination xsi:type="ns1:JobRepositoryDestination">

<folderURI xsi:type="xsd:string">/ContentFiles</folderURI>

<sequentialFilenames xsi:type="xsd:boolean">false</sequentialFilenames>

<overwriteFiles xsi:type="xsd:boolean">false</overwriteFiles>


<mailNotification xsi:type="ns1:JobMailNotification" xsi:nil="true"/>







Either ways i get the error - The named parameter Job is not in the call parameter.

Link to comment
Share on other sites

The service WSDL (which can be retrieved from http://.../jasperserver/services/ReportScheduler?wsdl) acts as a complete description of the service, including information on the operation parameters.


If you intend to write a PHP client for the JasperServer web service, I suggest you first check the PHP sample shipped with JS (for instance, take a look at reportJobSave.php). Also take a look at the web services guide.




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