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?
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());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With