Hi People,
I am building a PHP soap server and seem to be falling short on the WSDL side of things. Maybe this is not the best place to post but i thought it would be worth a shot!
I have a multi array being returned by my soap server and have tried all sorts of combinations to try and get the correct result but to no avail.
Here's my PHP array.
$dump->Fruits = array(
array("Name" => "Banana", "Colour" => "Yellow"),
array("Name" => "Pear", "Colour" => "Green"),
array("Name" => "Apple", "Colour" => "Red"),
array("Name" => "Orange", "Colour" => "Orange")
);
and here's the "types" portion of my WSDL file:
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://api.ibetx.com/api/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<complexType abstract="true" name="ArrayOfgetEvents">
<sequence>
<element name="Fruits" minOccurs="1" maxOccurs="20" nillable="true" type="xsd1:ArrayOfFruits"/>
</sequence>
</complexType>
<complexType name="ArrayOfFruits">
<sequence>
<element name="Name" type="xsd:string"/>
<element name="Colour" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
and this is the result i get:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<Results>
<Fruits>
<Name>Banana</Name>
<Colour>Yellow</Colour>
</Fruits>
<Fruits>
<Name>Pear</Name>
<Colour>Green</Colour>
</Fruits>
<Fruits>
<Name>Apple</Name>
<Colour>Red</Colour>
</Fruits>
<Fruits>
<Name>Orange</Name>
<Colour>Orange</Colour>
</Fruits>
</Results>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However what i really want returned is this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<Results>
Array(
[0] => Array
(
<Name>Banana</Name>
<Colour>Yellow</Colour>
)
[1] => Array
(
<Name>Pear</Name>
<Colour>Green</Colour>
)
[2] => Array
(
<Name>Apple</Name>
<Colour>Red</Colour>
)
[3] => Array
(
<Name>Orange</Name>
<Colour>Orange</Colour>
)
)
</Results>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Anyone have any ideas on how i can achieve this with WSDL?
Thanks in advance!