Avatar of benchpresser
benchpresser
 asked on

PHP NuSOAP - Allowed memory size of error XXXXXX

PHP is connected to SOAP between NuSOAP and I can recieve data from PHP. After getting data, I get timeout error because of data size is huge which is received. You can see xdebug print out on below.I can run same service using PHP native SOAP command.



I am using following settings. I can not get a solution about the above error although I increased maximum limit as possible as much.

ini_set('memory_limit', "512M");
ini_set('max_execution_time', 60000); //x saniye
ini_set("display_errors", 1);
ini_set("max_input_time ", 6000);

Open in new window


I am waiting your solution about this issue urgently. Thank for your support.

Edit: My NuSOAP client function:

function nusoapCall($method,$params,$returnType="array"){
    global $WSDLURL,$debugMode;
    require_once('tools/nusoap/nusoap.php');    
    $soapClient = new nusoap_client($WSDLURL, 'wsdl');
    $soapClient->soap_defencoding = 'UTF-8';
    $soapClient->decode_utf8 = false;
    $soapClient->setUseCURL(true);
    //$soapClient->loadWSDL();
    $soapClient->setCurlOption(CURLOPT_CONNECTTIMEOUT, 60);
    if($debugMode == 1){
        $soapClient->debug_flag = false;
    }

    $tResult = $soapClient->call( $method,$params);
    if($returnType=="object"){
        $tResult = array_to_object($tResult);
    }

    $soapError = $soapClient->getError();
    echo $soapClient->getDebug();
    if (!empty($soapError)) {

        $errorMessage = 'Nusoap object creation failed: ' . $soapError;
        throw new Exception($errorMessage);
        return false;
    }else{
        return $tResult;
    }
}

Open in new window

PHPSOAP Protocol

Avatar of undefined
Last Comment
gr8gonzo

8/22/2022 - Mon
gr8gonzo

Ultimately, if you're trying to solve the time-out, just add set_time_limit(0); to the top of your script. However, that will not resolve data size issues, so if you're running out of memory, the only thing to do is either request less data per SOAP call (if that applies here), or increase the memory limit further.
benchpresser

ASKER
Hello;
Firstly I want to say thanks for your answer gr8gonzo.
Unfortunately, I get the same error despite using site_time_limit(0). However, it is so weird I can take same size data with using Php native SOAP command. In here the reason I didn’t use Php native SOAP command is the connection has some problem uncertain frequency and can not take data. NuSOAP is perfect I have no connection problem and also other problems. It is so clear and usebility but only problem is memory_limit error. I have to solve this problem.
Thanks for your support.
gr8gonzo

set_time_limit, not site_time_limit. Double-check the spelling...
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
benchpresser

ASKER
sorry :) I mean using set_time_limit(0) replace to using site_time_limit(0)
ASKER CERTIFIED SOLUTION
gr8gonzo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gr8gonzo

Following up. What's the verdict?