note 110401 deleted from soapclient.soapcall by danbrown

From: Date: Thu, 18 Oct 2012 15:49:31 +0000
Subject: note 110401 deleted from soapclient.soapcall by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191427@lists.php.net to get a copy of this message
Note Submitter: php at mattjanssen dot com ---- If you're using a custom class object as a parameter (or nested within your parameters), and you store your data in a $_data[] attribute variable, you need to implement the __get($key) method in that custom class, or your data won't translate/convert into the XML. class ColorParam { private $_data = array(); __get($key) { return $_data[$key]; } public function setBackground($data) { $this-_data['background'] = $data; } } $client = new SoapClient(); $colorParam= new ColorParam(); $colorParam->setBackground('blue'); $client->sampleImageCall($colorParam);

« previous php.notes (#191427) next »