I'm trying to do some tests on a SOAP API and am experiencing extremely slow execution times. I've done some digging and found that it's the SoapClient constructor that takes forever to execute. I also tried using a proxy for it to see if it's the http query resulting from it, but this query is executed relatively fast.. it's after the query that it lingers for about 30 seconds.
Here's a kcachegrind screenshot for reference:
And here's the WSDL query in Charles Proxy:
This same problem has also been reported a couple of months ago here:
PHP: SoapClient constructor is very slow (takes 3 minutes)
But he did not get an answer.
Any suggestions would be much appreciated.
Edit:
The code portion where the SoapClient is initiated (this is part of the NetSuite PHP toolkit)
$this->client = new SoapClient( $host . "/wsdl/v" . $endpoint . "_0/netsuite.wsdl",
array( "location" => $host . "/services/NetSuitePort_" . $endpoint,
"trace" => 1,
"connection_timeout" => 5,
"typemap" => $typemap,
"user_agent" => "PHP-SOAP/" . phpversion() . " + NetSuite PHP Toolkit " . $version
)
);