title: Arrays wrapped in complex type are unwrapped in Java code (Axis 1.4)
body: <p>The WSDL looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsd:element name="Parent"&gt;
      &lt;xsd:complexType&gt;
          &lt;xsd:sequence&gt;
              &lt;xsd:element maxOccurs="unbounded" ref="tns:Child"/&gt;
          &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <h1>Expected behavior</h1>
  
  <p>If I let Axis 1.4 generate Java code based on the WSDL, I expect the following field in my object:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyComplexObject {
      private Parent parent;
  }
  </code></pre>
  
  <p>The <code>Parent</code> class would consist of an array of <code>Child</code> objects.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Parent {
      private Child[] child;
  }
  </code></pre>
  
  <h1>Actual behavior</h1>
  
  <p>The actual behavior is that the list of <code>Child</code> objects is defined directly on the parent object level:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyComplexObject {
      private Child[] parent;
  }
  </code></pre>
  
  <p>When we call the webservice by filling the array, It will result in the following XML:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Parent&gt;
      ...
  &lt;/Parent&gt;
  &lt;Parent&gt;
      ...
  &lt;/Parent&gt;
  </code></pre>
  
  <p>causing failures on the server side. It seems that Axis has difficulties with nested arrays of complex types. Anyone facing the same issue and knowing any workaround/fix?</p>
  
  <h1>Findings</h1>
  
  <p>After some investigation I was able to produce expected behavior by adding a dummy field to the XSD definition:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsd:element name="Parent"&gt;
      &lt;xsd:complexType&gt;
          &lt;xsd:sequence&gt;
              &lt;xsd:element name="Dummy" type="xsd:string"/&gt;
              &lt;xsd:element maxOccurs="unbounded" ref="tns:Child"/&gt;
          &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <p>It seems that, in this case, Axis correctly creates a <code>Parent</code> wrapper object:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Parent {
      private String dummy;
      private Child[] child;
  }
  </code></pre>
  
  <p>And my XML output is correct:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Parent&gt;
      &lt;Dummy&gt;...&lt;/Dummy&gt;
      &lt;Child&gt;...&lt;/Child&gt;
      &lt;Child&gt;...&lt;/Child&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>So it seems that this is really a bug in Axis 1.4...</p>