1

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?

Zorrocaesar
  • 748
  • 1
  • 7
  • 22
  • 1
    I assume you are trying to get the `Zend_Soap_Server` response to be identical to th `NuSOAP` response because the client is throwing some kind of error when it tries to process the response from the server? If so, what error is being thrown? – JamesG Feb 27 '12 at 12:20
  • @Zorrocaesar did you get anywhere with this? – richsage Dec 05 '13 at 09:44

0 Answers0