我使用的是 Netsuite PHPToolkit 2014_1 版。
$nsendpoint = "2014_1";
$nshost = "https://webservices.netsuite.com";
今天我在通过 webservice 登录时收到此错误
You are not requesting the correct data center for your company ! Please correct the host in the URL.
这是我的回答
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>
soapenv:Server.userException
</faultcode>
<faultstring>
You are not requesting the correct data center for your company ! Please correct the host in the URL.
</faultstring>
<detail>
<platformFaults:unexpectedErrorFault xmlns:platformFaults="urn:faults_2014_1.platform.webservices.netsuite.com">
<platformFaults:code>
USER_ERROR
</platformFaults:code>
<platformFaults:message>
You are not requesting the correct data center for your company ! Please correct the host in the URL.
</platformFaults:message>
</platformFaults:unexpectedErrorFault>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
partners-java10010.bos.netledger.com
</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
它之前运行良好。
最佳答案
如今,每个客户的 NetSuite 数据中心 URL 都不同。
配置 NSconfig.php 后,运行以下脚本来识别端点 URL。示例来自PHPToolkit_2018_2的samples文件夹,
require_once 'PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$service->useRequestLevelCredentials(false);
$params = new GetDataCenterUrlsRequest();
$params->account = NS_ACCOUNT;
$response = $service->getDataCenterUrls($params);
$webservicesDomain = $response->getDataCenterUrlsResult->dataCenterUrls->webservicesDomain;
print "url: $webservicesDomain";
一旦您获得了 URL,您就可以将其输入到您的配置中。
关于php - 网络套件错误 :You are not requesting the correct data center for your company",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25683169/