My PHP is a little rusty so I could just be overlooking something simple. I'm trying to write a client for webservice, the WSDL is available here. I used wsdl2php to create a list of functions and classes which allows me to read and write data through the web portal. One of the functions, AddNewCustomer, requires an instance of the class TIntactCustomer to be passed as an array, normally this would work, but on the portal the Balance property is set to Read-Only and the function returns an error.
The developers of the portal have suggested I remove Balance from the array, which gives me this error; Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] '' is not a valid floating point value.
If I remove Balance from the class also, I get this error Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'Balance' property in /Applications/xampp/xamppfiles/htdocs/intact/lib/IIntactservice.php:685
Has anyone any idea?
Thanks
Andrew
require_once 'IIntactservice.php';
$customer = new IIntactservice();
$newcustomer = new TIntactCustomer();
$newcustomer->Code = "ALED001";
$newcustomer->Name = "Customer Name";
$newcustomer->Address1 = "365 Old Road";
$newcustomer->Address2 = "Lisburn";
$newcustomer->Address3 = "";
$newcustomer->Address4 = "";
$newcustomer->Address5 = "";
$newcustomer->PostCode = "BT26 6TH";
$newcustomer->Balance = 0;
$newcustomer->OnOrder = 0;
$newcustomer->Unbilled = 0;
$newcustomer->UnAllocated = 0;
$newcustomer->CreditLimit = 0;
$newcustomer->Phone1 = "02854339047";
$newcustomer->Phone2 = "";
$newcustomer->Fax = "";
$newcustomer->EMail = "aled@email.co.uk";
$newcustomer->YTDNetTurnover = 0;
$newcustomer->DeliveryAddress1 = "";
$newcustomer->DeliveryAddress2 = "";
$newcustomer->DeliveryAddress3 = "";
$newcustomer->DeliveryAddress4 = "";
$newcustomer->DeliveryAddress5 = "";
$newcustomer->DefaultVATRate = 2;
$newcustomer->HoCode = "";
$newcustomer->IsHo = False;
$result = $customer->AddNewCustomer($newcustomer);
print_r($result);