Re: Requesting a webservice...
| From: | Justin Patrin | Date: | Wed, 10 Dec 2003 16:03:07 +0000 |
| Subject: | Re: Requesting a webservice... | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9458@lists.php.net to get a copy of this message | ||
Mike Carter wrote:
Quick note: Assoc arrays and objects are treated the same in PEAR::SOAP. If you send an assoc array to a webservice, it comes out on the server as an object. -- paperCrane <Justin Patrin>-----Original Message----- From: Dennis T. [mailto:viol8r@nospam.dk] Mike Carter wrote:I'm sure the serialization produces different XML when having an array of objects as opposed to an array of arrays. My suggestion would be something along the lines of an object containing the details of a single location (stretname, town, county etc.). Then add this single location object ($locationObj) to the master $address array using: $address[] = new SOAP_Value("{<enteryourWSnamespacehere>}Location", false, $locationObj); However, this may not be fixing your problem anyway. Regards, Mike C. ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________That would be the same as $address[]['Location']['AddressStreetName']="...", which doesn't work. I also tried it with objects, but there doesn't seem to be any difference.From: Dennis T. [mailto:viol8r@nospam.dk] The call in php would then be something like this. $wsdl = new SOAP_WSDL('http:/...'); $locations = $wsdl->getProxy(); $result = $locations->getLocation($address,false,$user); The problem is the $address variable - how should it look? I found out that it needs to be like this: $address['Location']['AdressStreetName'] = "Some-street"; And that works fine as long as there is only one element of Location. But how can I specify more Locations (since it isn't posible to have an array with several of the same keys ['Location']).Try an array of objects. Each objetc with a 'Location' attribute.