Tuesday, February 26, 2019

PHP > 2012.2 Toolkit > How to check the status of an Async Web Services Request based on user request

The follow Sample will show you have to check the status of an Asynchronous Web Services Request based on user request.
Please note the login credientials are on the NSConfig.php file.

require_once '../PHPToolkit/NetSuiteService.php';

//Creates the NetSuite Service object to perform the operations
$service = new NetSuiteService();

//Hard coded the job ID retrieved from Process Status (Setup > Integration > Web Services Process Status)
$jobId="ASYNCWEBSERVICES_TSTDRV945834_0513201316129973012141268339_8";

//CheckAsyncStatusRequest object is required to perform the checkAsync Operation, all necessary fields are below
$status = new CheckAsyncStatusRequest();
$status->jobId = $jobId;
$status->pageIndex = 1;

//Process the request and store it in a variable
$result = $service->checkAsyncStatus($status);


// Display the results returned.
echo print_r($result);

No comments:

Post a Comment