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!