Re: [SOAP] private properties + numeric keys

From: Date: Fri, 21 Mar 2003 19:29:40 +0000
Subject: Re: [SOAP] private properties + numeric keys
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-497@lists.php.net to get a copy of this message
Sandro Zic wrote:
Hi, I was told at pear-dev that my below questions are better sent to this list. The PEAR::SOAP version I used is 0.7.1 Thanks for any help, Sandro ---------- Forwarded Message ---------- Subject: [PEAR-DEV] PEAR::SOAP problems Date: Sat, 15 Mar 2003 18:46:01 +0100 From: Sandro Zic <sandro.zic@zzoss.com> To: pear-dev@lists.php.net Hi, some problems with PEAR::SOAP: 1) hiding private properties when trying to transfer a struct with underscore keys like '_id' from a PEAR::SOAP server to a PEAR::SOAP client, I realized that it hides them from the output. This means that the client will not receive a return value from a remote procedure returning an array like return array('_key' => 'value'); I guess this has been done to protect private properties of PHP classes, but I doubt this is the correct behaviour of a SOAP implementation, because the remote procedure should care about hidden properties, not the SOAP transport layer. Is there an option to turn this off?
Not at this time, but I'll keep that in mind in the next couple weeks. The soap library will serialize/deserialize php objects, and yes, that was done to allow 'private' vars in classes. PHP 5 will solve this issue, and many others.
2) replacing numeric keys with 'item'
You cannot have numeric tags, so array's are done that way, it's standard in all soap implementations I've looked at, and for de/serializing simple arrays, there isn't much more that can be done with it. If you're using sparse array's and need to maintain the indexing ($x = array(1=>'abc',5=>'cde');), you're a bit out of luck for now. Shane

« previous php.soap (#497) next »