Note: This article requires existing knowledge of Web Services and PHP.
Below is sample code for a getDataCenterUrls request. The sample code also updates the endpoint in the NetSuiteService object if successful.
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$request = new GetDataCenterUrlsRequest();
$request->account = $nsaccount;
$Response = $service->getDataCenterUrls($request);
echo "ERROR - " . $Response->getDataCenterUrlsResult->status->statusDetail[0]->code
. $Response->getDataCenterUrlsResult->status->statusDetail[0]->message;
} else {
echo " SUCCESS " . $Response->getDataCenterUrlsResult->dataCenterUrls->webservicesDomain;
$nshost = $Response->getDataCenterUrlsResult->dataCenterUrls->webservicesDomain; //Set the datacenter endpoint in the $nshost object
$service = new NetSuiteService(); //Recreate the service using the new endpoint
}
// Additional code...
No comments:
Post a Comment