Question

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:

kcachegrind

And here's the WSDL query in Charles Proxy:

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

                                    )

    );
Was it helpful?

Solution

Are you using multiple users? I was getting 3-20 minute lags on the same line of code which turned out to be related to multiple users causing multiple copies of the wsdl to be fetched. http://www.ozonesolutions.com/programming/2011/05/nsclient-login-time/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top