title: Magento API V2 - WSDL and associative multi arrays
body: <p>I extended the Magento V2 API and therefore created a wsdl.xml. My webservice returns a associative multi array. I googled a little bit and found two definitions of complex types:</p>
  
  <pre><code>&lt;complexType name="associativeMultiArray"&gt;
      &lt;all&gt;
          &lt;element name="associativeArray" type="typens:associativeArray" minOccurs="0" /&gt;
      &lt;/all&gt;
  &lt;/complexType&gt;
  &lt;complexType name="stringArray"&gt;
      &lt;all&gt;
          &lt;element name="multi_data" type="typens:associativeMultiArray" minOccurs="0" /&gt;
      &lt;/all&gt;
  &lt;/complexType&gt;
  
  &lt;message name="methodResponse"&gt;
      &lt;part name="result" type="typens:stringArray" /&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>The other one:</p>
  
  <pre><code>&lt;complexType name="associativeMultiArray"&gt;
      &lt;complexContent&gt;
          &lt;restriction base="soapenc:Array"&gt;
              &lt;attribute ref="soapenc:arrayType" wsdl:arrayType="typens:associativeMultiEntity[]"/&gt;
          &lt;/restriction&gt;
      &lt;/complexContent&gt;
  &lt;/complexType&gt;
  
  &lt;complexType name="associativeMultiEntity"&gt;
      &lt;all&gt;
          &lt;element name="key" type="xsd:string"/&gt;
          &lt;element name="value" type="typens:ArrayOfString"/&gt;
      &lt;/all&gt;
  &lt;/complexType&gt;
  
  &lt;complexType name="ArrayOfString"&gt;
      &lt;complexContent&gt;
          &lt;restriction base="soapenc:Array"&gt;
              &lt;attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/&gt;
          &lt;/restriction&gt;
      &lt;/complexContent&gt;
  &lt;/complexType&gt;
  
  &lt;message name="methodResponse"&gt;
      &lt;part name="result" type="typens:associativeMultiArray" /&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>The problem is, none of these two works. If I output the result after the query I get:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
      (
      )
  )
  </code></pre>
  
  <p>It doesn't matter if I return <code>array('test)</code> or <code>array('key'=&gt;'value')</code>, it is always the same output. Basically I have two questions:</p>
  
  <ul>
  <li>Are <code>ArrayOfString</code>, <code>associativeArray</code> and <code>associativeMultiArray</code> declarations of the following: <code>&lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento"&gt;
          &lt;import namespace="http://schemas.xmlsoap.org/soap/encoding/"
              schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/&gt;</code> ?</li>
  <li>If I have very complex array structures like 10 dimensional associative arrays, do I have to declare every dimension in the wsdl.xml? How do I handle this? How does it work? Why don't the above declarations not work?</li>
  </ul>