简体   繁体   English

PHP5 Soap Function不返回,脚本停止

[英]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. 我正在使用PHP 5进行SOAP调用,在调用之后,无论我作为参数传递什么,soap函数都不会返回任何值,并且脚本的执行似乎停止了。 I have tried with and without the try, and there is no change. 我已经尝试了,没有尝试,并且没有变化。 I have passed empty $params, non empty params, etc. 我已经传递了空的$ params,非空的params等。

After this line: $client->getClient($params); 在此行之后:$ client-> getClient($ params);

There is an echo for b, which never gets echoed. b有一个回声,它永远不会回声。 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. 没有显示错误,并且在error_log中没有任何显示。 Very frustrating, any ideas? 非常沮丧,有什么想法吗?

$params = array(); $ 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. 如果以WSDL模式工作,则不得使用location -parameter。 They should be mutually exclusive. 它们应该互斥。 Try removing the location -parameter. 尝试删除location -parameter。

EDIT (because the above didn't help): 编辑 (因为上面没有帮助):

Try to check if the SoapClient could parse the WSDL correctly: 尝试检查SoapClient是否可以正确解析WSDL:

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

Is there any authentication in place, eg HTTP authentication on the WSDL document? 是否有任何身份验证,例如WSDL文档上的HTTP身份验证?

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. 似乎您正在连接到.NET webswervice,并且它们的WSDL往往会变得很大-PHP可能需要一些时间来解析WSDL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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