title: Example of wrapped document/literal array
body: <p>I've having trouble finding a solid example of a simple array in a wrapped document/literal style.</p>
  
  <p>Consider a PHP function that generates an array up to a max count.</p>
  
  <pre><code>/**
   * @param int $max
   * @return string[] $count
   */
  public function countTo($max)
  {
      $array = array();
      for ($i = 0; $i &lt; $max; $i++) {
          $array[] = 'Number: ' . ($i + 1);
      }
      return $array;
  }
  </code></pre>
  
  <p>The WSDL types generated for this are:</p>
  
  <pre><code>&lt;xsd:complexType name="countTo"&gt;
    &lt;xsd:sequence&gt;
      &lt;xsd:element name="max" type="xsd:int"/&gt;
    &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:element name="countTo" nillable="true" type="ns:countTo"/&gt;
  &lt;xsd:complexType name="ArrayOfCount"&gt;
    &lt;xsd:sequence&gt;
      &lt;xsd:element minOccurs="0" maxOccurs="unbounded" name="count" nillable="true" type="xsd:string"/&gt;
    &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:complexType name="countToResponse"&gt;
    &lt;xsd:sequence&gt;
      &lt;xsd:element name="count" type="ns:ArrayOfCount"/&gt;
    &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:element name="countToResponse" nillable="true" type="ns:countToResponse"/&gt;
  </code></pre>
  
  <p>The request in the body would look like:</p>
  
  <pre><code>&lt;ns1:countTo&gt;
    &lt;max&gt;5&lt;/max&gt;
  &lt;/ns1:countTo&gt;
  </code></pre>
  
  <p>But what does the response look like, and what is the convention?</p>
  
  <p>Currently, SoapServer is generating</p>
  
  <pre><code>&lt;ns1:countToResponse&gt;
    &lt;count&gt;
      &lt;count&gt;Number: 1&lt;/count&gt;
      &lt;count&gt;Number: 2&lt;/count&gt;
      &lt;count&gt;Number: 3&lt;/count&gt;
      &lt;count&gt;Number: 4&lt;/count&gt;
      &lt;count&gt;Number: 5&lt;/count&gt;
    &lt;/count&gt;
  &lt;/ns1:countToResponse&gt;
  </code></pre>
  
  <p>I'm not sure about the nested <code>count</code> elements.  Perhaps this should be <code>item</code> instead (and the WSDL would need to be updated to make it happen).</p>
  
  <pre><code>&lt;ns1:countToResponse&gt;
    &lt;count&gt;
      &lt;item&gt;Number: 1&lt;/item&gt;
      &lt;item&gt;Number: 2&lt;/item&gt;
      &lt;item&gt;Number: 3&lt;/item&gt;
      &lt;item&gt;Number: 4&lt;/item&gt;
      &lt;item&gt;Number: 5&lt;/item&gt;
    &lt;/count&gt;
  &lt;/ns1:countToResponse&gt;
  </code></pre>