7

I'm converting an old code which use NuSoap to PHP Soap Library. But method getError in NuSoap PHP seems not exist in PHP Soap Libary and I get this error:

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 

Here is my code:

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

How I supposed to get error in PHP Soap library?

hakre
  • 178,314
  • 47
  • 389
  • 754
bman
  • 3,698
  • 3
  • 31
  • 63
  • I had this problem to and when I changed SoapClient() to nusoap_client(), It solved. – N.M Jan 18 '17 at 09:12

1 Answers1

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

?>

If there is any error It with the soapCall .It returns a instance of SoapFault() where you can log the errorcode, description so.. on

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

Someone
  • 9,895
  • 23
  • 62
  • 98