试图使用phptoolkit获取客户信息--以下是我的代码:
function getCustomer(){
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->account_id = "252206";
$request->baseRef->type = "customer";
$getResponse = $service->get($request);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
$customer = $getResponse->readResponse->record;
echo "GET SUCCESS, customer:";
echo "\nCompany name: ". $customer->companyName;
echo "\nInternal Id: ". $customer->internalId;
echo "\nEmail: ". $customer->email;
}
}会犯这样的错误。
致命错误: SoapFault异常: soapenv:Server.userException无法确定phptoolkit/nSPHPClient.php中的客户强度:338个堆栈跟踪:#0 phptoolkit/NSPHPClient.php(338):SoapClient->_soapCall(‘get’,Array,NULL,Array) #1 phptoolkit/NetSuiteService.php(145953):NSPHPClient->makeSoapCall(‘get,Object(GetRequest)) #2 netsuite.php(23):NetSuiteService->get(GetRequest) #3 #
发布于 2019-07-26 03:51:12
基于netsuite文档,RecordRef只接受internalId和type
$request->baseRef = new RecordRef();
$request->baseRef->internalId = "252206";
$request->baseRef->type = "customer";发布于 2018-03-14 09:57:45
您需要知道公司ID并将其放入您的设置文件中。还需要用户电子邮件地址、密码、角色内部ID和应用程序ID。这些都用于创建护照。
如果您的集成使用基于令牌的授权,则需求是不同的。
查看工具箱中的示例。
https://stackoverflow.com/questions/49269506
复制相似问题