//set the authentication
call.setUsername("user@email.com");
call.setPassword("password");
//make the call to generate the order report
StandardCallResult result = call.callGenerateReportNow();
if ( result.getSuccess() != null )
{
System.out.println("Sucess :" + result.getSuccess() );
/* wait a while for the report to be generated,
* reports can take several minutes to be generated
*/
Thread.sleep( 30000 );
//we requested a report from the previous run, try and get the report ID for it
GetReportStatusCall getreportstatus = new GetReportStatusCall(ReportName.Order);
getreportstatus.setNumberOfReports(3);
//set the authentication
call.setUsername("user@email.com");
call.setPassword("password");
//make the call
GetReportStatusCallResult rsresult = getreportstatus.callGetReportStatus();
//have a look at all the reports
Report[] report = rsresult.getReports();
for (int i = 0; i < report.length; i++)
{
Date endtime = PlayTradeUtils.parsePlayTradeDateTime( report[i].getReportendtime() );
Date starttime = PlayTradeUtils.parsePlayTradeDateTime( report[i].getReportstarttime() );
System.out.println("Report ID: "+report[i].getReportid() + ", start=" + starttime + ", endtime=" + endtime );
}
}
else
{
throw new Error("Error :" + result.getBusinessLogicError() );
}
}