Getting arrays from a server?

From: Date: Tue, 10 Jun 2003 15:18:10 +0000
Subject: Getting arrays from a server?
Groups: php.soap 
Request: Send a blank email to php-soap+get-701@lists.php.net to get a copy of this message
Hi guys, Not sure if this is a .Net related SOAP issue with PEAR:SOAP or what. A method returns a result which is an array, it can be 1 or more entries in the array. When the array has two entries the XML wire sent back looks like this:- <PmaRoleList> <PmaRole> <PmaRoleId>2</PmaRoleId> <PmaRoleRef>Doctor</PmaRoleRef> <PmaRoleName>Doctor</PmaRoleName> </PmaRole> <PmaRole> <PmaRoleId>3</PmaRoleId> <PmaRoleRef>MedicalSecretary</PmaRoleRef> <PmaRoleName>Medical Secretary</PmaRoleName> </PmaRole> </PmaRoleList> When just one entry is in the array returned the XML looks like this:- <PmaRoleList> <PmaRole> <PmaRoleId>1</PmaRoleId> <PmaRoleRef>Member</PmaRoleRef> <PmaRoleName>Member</PmaRoleName> </PmaRole> </PmaRoleList> All fairly standard right? The problem comes when I var_dump() the result back once PEAR::SOAP has converted the XML to objects and arrays. The array with one entry appears as an object, whilst the two entry array appears as an array with two entries. This makes writing code to handle an array of unknown size a real pain currently :-/ Could this be something to fix soon please? I can help with testing/debugging over the next few days. Kind regards, -- Mike Carter [web developer] tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com This message is confidential. Unless you are the named addressee or their delegated representative you may not use, disclose, or copy the contents of the e-mail. If you are not the named addressee please notify the sender immediately and delete the material from your computer. Any views or opinions contained in this e-mail are solely those of the author unless expressly stated otherwise --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.484 / Virus Database: 282 - Release Date: 5/27/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.soap (#701) next »