Package uk.co.purebuy.commerce.businessobjects.importexport.playtrade.call

Examples of uk.co.purebuy.commerce.businessobjects.importexport.playtrade.call.StandardCallResult


    //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() );
    }
  }
View Full Code Here

TOP

Related Classes of uk.co.purebuy.commerce.businessobjects.importexport.playtrade.call.StandardCallResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.