Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Uncaught SoapFault exception: [soap:Server] Fault occurred while processing

I use this code

error_reporting(E_ALL);
ini_set('display_errors', 1);

$params = array(
    'username' => 'username',
    'password' => 'password',
    'cocNo' => '1060907A'
);

$client = new SoapClient('URL/?wsdl',array('trace'=>1));
//$response = $client->__getTypes();
$response = $client->__getFunctions();
pint_r($response);

and get this successful response:

Array ( [0] => verifyResponse verify(verify $parameters) ) 

but when i use this code

$response = $client->__soapcall('verify',array($params));

I got this response error

Fatal error: Uncaught SoapFault exception: [soap:Server] Fault occurred while processing. in /PATH/index.php:22 
Stack trace: #0 /PATH/index.php(22): SoapClient->__soapCall('verify', Array) #1 {main} thrown in /PATH/index.php on line 22 

What is wrong with my call?

like image 702
user3444921 Avatar asked Dec 05 '25 07:12

user3444921


1 Answers

According to $client->__getTypes() you are missing an 'arg0' element in your data structure. Change your code to:

try 
{
  $response = $client->verify(array('arg0' => $params));
} 
catch(Exception $e)
{
  var_dump($e->getMessage());
}
like image 84
Kris Peeling Avatar answered Dec 07 '25 21:12

Kris Peeling



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!