Netsuite error: You must use account-specific domains with the 2019.1 SOAP web services endpoint

Netsuite error: You must use account-specific domains with the 2019.1 SOAP web services endpoint

我正在使用 SOAPUI 调用 netsuite 的 soap API 但是当我添加 wsdl https://5450407-sb1.app.netsuite.com/wsdl/v2019_1_0/netsuite.wsdl

我收到以下错误:

<?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 must use account-specific domains with the 2019.1 SOAP web services endpoint. You can use the SOAP getDataCenterUrls operation to obtain the correct domain. Or, go to Setup > Company > Company Information in the NetSuite UI. Your domains are listed on the Company URLs tab.
            </faultstring>
            <detail>
                <platformFaults:unexpectedErrorFault xmlns:platformFaults="urn:faults_2019_1.platform.webservices.netsuite.com">
                    <platformFaults:code>
                        USER_ERROR
                    </platformFaults:code>
                    <platformFaults:message>
                        You must use account-specific domains with the 2019.1 SOAP web services endpoint. You can use the SOAP getDataCenterUrls operation to obtain the correct domain. Or, go to Setup > Company > Company Information in the NetSuite UI. Your domains are listed on the Company URLs tab.
                    </platformFaults:message>
                </platformFaults:unexpectedErrorFault>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
                    partners022.prod.bos.netledger.com
                </ns1:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

当我从代码调用相同的代码时,thi 工作正常,但从 soap API 这只会给我错误。如果有人可以,请帮助解决这个问题。

谢谢

我找到了解决方案:使用 URL https://5450407.suitetalk.api.netsuite.com/services/NetSuitePort_2019_1

尝试了解 netsuite soap 中的流程API:

  1. 它使用您帐户的凭据创建客户端,然后它 return 帐户 ID,然后
  2. 使用您的 soap 端点将创建的帐户 ID 用于命中其他 netsuite API

这就像一个身份验证安全。

作为最佳实践,与 NetSuite 的集成必须与数据中心无关。永远不要硬编码 URLs 来指定数据中心,因为帐户可以从一个数据中心移动到另一个数据中心。 在 NetSuite 中,有两种类型的 URLs:

  • URLs 用于特定于数据中心的域:例如,system.na3.netsuite.com(na3/NA 中部)此数据中心在北美托管生产帐户。
  • URLs 用于特定于帐户的域:它包含帐户 ID,并且不依赖于托管帐户的数据中心。

请转到“设置”>“公司”>“公司信息”,然后单击“公司”URL 以查看您帐户中可用的帐户特定域。