You are here: SOAP problem: how to pass multiple occurrence of an element? « PHP Programming Language « IT news, forums, messages
SOAP problem: how to pass multiple occurrence of an element?

Posted by forcey on 11/18/07 03:07

Hi all,

I'm writing a SOAP server using the SOAP extension and I need to
return an array_map_name_balance, which is defined in a WSDL file like
this:

<xsd:complexType name="map_name_balance">
<xsd:sequence>
<xsd:element name="username" type="xsd:string"></xsd:element>
<xsd:element name="balance" type="xsd:float"></xsd:element>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="array_map_name_balance">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="map" type="tns:map_name_balance"></xsd:element>
</xsd:sequence>
</xsd:complexType>

However, if I return an object like:
stdClass Object
(
[map] => Array
(
[0] => stdClass Object
(
[username] => forcey
[balance] => 13.83
)

[1] => stdClass Object
(
[username] => someone_else
[balance] => -13.17
)
)
)

the server throws an exception: SOAP-ERROR: Encoding: object hasn't
'username' property. I also tried to return:
Array
(
[0] => stdClass Object
(
[map] => stdClass Object
(
[username] => forcey
[balance] => 13.83
)
)

[1] => stdClass Object
(
[map] => stdClass Object
(
[username] => onelittlefox
[balance] => -13.17
)
)
)

and the server complains that object hasn't a 'map' property. So what
is the problem? How can I return the data?

Thank you all!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация