2
votes

I using Netsuite PHPToolkit version 2014_1.

$nsendpoint = "2014_1";
$nshost = "https://webservices.netsuite.com";

Today I received this error when login via webservice

You are not requesting the correct data center for your company ! Please correct the host in the URL.

This is my response

<?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>

It was working well before.

5

5 Answers

4
votes

Today the NetSuite Data Center URL is different for each customer.

After configuring NSconfig.php, run the following script to identify the endpoint URL. The example comes from the samples folder of PHPToolkit_2018_2,

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";

Once you have the URL you can then enter that in your configuration.

2
votes

The answer from @Charlie Dalsass to use getDataCenterUrls is 100% correct if your SuiteTalk client will be accessing multiple NetSuite accounts.

However, if your client will only use one account, you can probably get away with hardcoding the URL

https://1234567.suitetalk.api.netsuite.com

where 1234567 is your account ID. So, an example WSDL URL you'd pass to your SOAP client would be

https://1234567.suitetalk.api.netsuite.com/wsdl/v2018_1_0/netsuite.wsdl
2
votes

I've come across that error but not in that context.
I have found it whilst working on accounts that have the system.netsuite.com data center specified and sometimes have to switch to system.na1.netsuite.com
I would give na1 a try.

I believe it's related to the 2 data centers across the States, East / West Coast and the way requests are routed.

0
votes

I got this error , but for me the mistake was with my account_id I was using, it's case sensitive