I had a Soap server build on Nusoap. One of the methods returned something like this:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://test.webservice/soap/">
<SOAP-ENV:Body>
<ns1:get_itemsResponse xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:SelectItem[18]">
<item xsi:type="tns:SelectItem">
<id xsi:type="xsd:int">6</id>
<name xsi:type="xsd:string">This is the first item</name>
</item>
<item xsi:type="tns:SelectItem">
<id xsi:type="xsd:int">7</id>
<name xsi:type="xsd:string">This is another item</name>
</item>
...
Now I have switched to Zend Soap and I just cannot make the response to look like above. The closest I got was something like this:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://another.webservice/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:get_ItemsResponse>
<return xsi:type="ns1:SelectResponse">
<items SOAP-ENC:arrayType="ns1:SelectItem[18]" xsi:type="ns1:ArrayOfSelectItem">
<item xsi:type="ns1:SelectItem">
<id xsi:type="xsd:int">6</id>
<name xsi:type="xsd:string">This is the first item</name>
</item>
<item xsi:type="ns1:SelectItem">
<id xsi:type="xsd:int">7</id>
<name xsi:type="xsd:string">This is another item</name>
</item>
...
I use the autodiscovery feature of Zend_Soap and these are the two clases involved:
class SelectResponse
{
/** @var SelectItem[] */
public $items;
}
class SelectItem
{
/** @var int */
public $id;
/** @var string */
public $name;
}
Do you have any idea how could I obtain a similar response with Zend_Soap as the one with Nusoap?