Debtor_Create Error

Forum for .PHP developers using the E-conomic API.
Exchange your ideas, tip and tricks using the API.
Best Practices

Debtor_Create Error

Postby china li » Tue Apr 19, 2011 7:49 am

Hello,

I am a PHP programmer, and I have encountered a problem with Debtor_Create() function provided by the API. When I run the code, I

receive the following error:

// error string(54) "SOAP-ERROR: Encoding: object hasn't 'vatZone' property"

I think this has something to do with the array I am creating to enter the person’s data, but I am not sure. Can anyone tell me what

portion of my code is incorrect? Here is my code:


set_time_limit(0);
$wsdlUrl = 'https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL';
$client = new SoapClient($wsdlUrl, array("trace" => 1, "exceptions" => 1));
$client->Connect(array(
'agreementNumber' => 'xxxxxx',
'userName' => 'xxxxxx',
'password' => 'xxxxxx'
)
);

$number = $client->Debtor_GetNextAvailableNumber()->Debtor_GetNextAvailableNumberResult;
try {
$client->Debtor_Create(array(
'Number' => $number,
'VatZone' => 'HomeCountry',
'Name' => 'Homer J. Simpson'
));

} catch (Exception $e) {
var_dump($e->getMessage());
}




Thank you!
-
china li
 
Posts: 5
Joined: Mon Apr 18, 2011 5:10 am

Return to PHP



cron