title: How to use a complex type from a WSDL with zeep in Python
body: <p>I have a WSDL that contains a complex type like so:</p>
  
  <pre><code>&lt;xsd:complexType name="string_array"&gt;
    &lt;xsd:complexContent&gt;
      &lt;xsd:restriction base="SOAP-ENC:Array"&gt;
        &lt;xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/&gt;
      &lt;/xsd:restriction&gt;
    &lt;/xsd:complexContent&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p>I have decided to use <a href="https://github.com/mvantellingen/python-zeep" rel="noreferrer">zeep</a> for the soap client and want to use that type as a parameter to one of the other methods referenced in the WSDL. I can't seem to figure out how to use this type though. When I looked through the <a href="http://docs.python-zeep.org/en/master/datastructures.html" rel="noreferrer">documentation</a> on how to use certain data structures referenced in the WSDL, it says to use the <code>client.get_type()</code> method, so I did the following:</p>
  
  <pre><code>wsdl = "https://wsdl.location.com/?wsdl"
  client = Client(wsdl=wsdl)
  string_array = client.get_type('tns:string_array')
  string_array('some value')
  client.service.method(string_array)
  </code></pre>
  
  <p>This give an error <code>TypeError: argument of type 'string_array' is not iterable</code>. I also tried many variations of that as well as trying to use a dictionary like so: </p>
  
  <pre><code>client.service.method(param_name=['some value']) 
  </code></pre>
  
  <p>Which gives the error </p>
  
  <pre><code>ValueError: Error while create XML for complexType '{https://wsdl.location.com/?wsdl}string_array': Expected instance of type &lt;class 'zeep.objects.string_array'&gt;, received &lt;class 'str'&gt; instead.`
  </code></pre>
  
  <p>If anyone knows how to use the above type from the WSDL with zeep, I would be grateful. Thanks.</p>