API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Debtor_Create Error

0
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!
created Apr 19, 2011 by china li
0% Accept Rate
Q 5 A 0 C 0

1 Answer

0
Hi.

I ran in to the same problem when I started, my solution was this


//Fake Enum for VatZone
$VatZones = array('HomeCountry','EU','Abroad');

and then call it like this

'VatZone' = $VatZones0,


It's the only thing have managed to get working
answered May 5, 2011 by Madman
Visma e-conomic A/S
...