简体   繁体   中英

PHP5 Soap Function does not return, script stops

I am making a SOAP call using PHP 5, after the call, no matter what I pass as the parameteres, the soap function simply does not return a value and the execution of the script seems to stop. I have tried with and without the try, and there is no change. I have passed empty $params, non empty params, etc.

After this line: $client->getClient($params);

There is an echo for b, which never gets echoed. It's as if the script just stops running after the call is made. There is no error displayed, and nothing shows up in the error_log. Very frustrating, any ideas?

$params = array();

$client = new SoapClient("https://sandbox.paymentsgateway.net/WS/Client.wsdl",array(
                    'soap_version'=>SOAP_1_1,
                    'exceptions'=>true,
                    'trace'=>1,
                    'cache_wsdl'=>WSDL_CACHE_NONE,
                    'location'=>'https://sandbox.paymentsgateway.net/WS/Client.svc/basic'
                ));

     try
    {
        echo '4';
        $client->getClient($params);
        echo 'b';
    }
    catch (Exception $e)
    {
        echo $e->getMessage();
    }

If working in WSDL-mode you must not use the location -parameter. They should be mutually exclusive. Try removing the location -parameter.

EDIT (because the above didn't help):

Try to check if the SoapClient could parse the WSDL correctly:

print_r($client->__getFunctions());
print_r($client->__getTypes());

Is there any authentication in place, eg HTTP authentication on the WSDL document?

Does your script run into the execution time or memory limit? It looks as though you're connecting to a .NET webswervice and their WSDLs tend to grow quite large - it may take some time for PHP to parse the WSDL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM