NuSoap与PHP肥皂库。 getError在哪里?

时间:2011-07-27 17:31:21

标签: php soap nusoap soap-client

我正在将使用NuSoap的旧代码转换为PHP Soap Library。但是,在PHP Soap Libary中,NuSoap PHP中的方法getError似乎不存在,我得到了这个错误:

Fatal error: Uncaught SoapFault exception: 
[Client] Function ("getError") is not a valid method for this service in index.php:33
Stack trace: #0 index.php(33): SoapClient->__call('getError', Array) #1 index.php(33):
SoapClient->getError() #2 index.php(63): pay() #3 {main} thrown in /homeindex.php on line 33 

这是我的代码:

<?php
    $client = new SoapClient('my soap server');
    $err = $client->getError();
?>

我应该如何在PHP Soap库中出错?

1 个答案:

答案 0 :(得分:4)

<?php
    $client = new SoapClient('my soap server');
    $err = $client->soapCall($somfunctioname,$arrofargs );

?>

如果有任何错误,请使用soapCall。它返回一个SoapFault()实例,您可以在其中记录错误代码,描述如此..

http://www.php.net/manual/en/soapclient.soapcall.php