title: wsdl2py requests
body: <p>I'm trying to get results from a SOAP service called Chrome ADS (for vehicle data). They provided php and Java samples, but I need python (our site is in Django). My question is:</p>
  
  <p>What should I be passing as a request to the SOAP service when using wsdl2py-generated classes?</p>
  
  <p>Following the examples I'm using a DataVersionsRequest object as the request parameter, but the code generated by wsdl2py seems to want a getDataVersions object, and there's something like that defined at the bottom of the generated _client.py file. But that too seems to throw an error. So I'm not sure what I should be passing as the request obj.  Any suggestions?</p>
  
  <pre><code>$sudo apt-get install python-zsi
  $wsdl2py http://platform.chrome.com/***********
  $python 
  &gt;&gt;&gt; url = "http://platform.chrome.com/***********"
  &gt;&gt;&gt; from AutomotiveDescriptionService6_client import *
  &gt;&gt;&gt; from AutomotiveDescriptionService6_types import *
  &gt;&gt;&gt; locator = AutomotiveDescriptionService6Locator()
  &gt;&gt;&gt; service = locator.getAutomotiveDescriptionService6Port()
  &gt;&gt;&gt; locale = ns0.Locale_Def('locale')
  &gt;&gt;&gt; locale._country="US"
  &gt;&gt;&gt; locale._language="English"
  &gt;&gt;&gt; acctInfo = ns0.AccountInfo_Def('accountInfo')
  &gt;&gt;&gt; acctInfo._accountNumber=*****
  &gt;&gt;&gt; acctInfo._accountSecret="*****"
  &gt;&gt;&gt; acctInfo._locale = locale
  &gt;&gt;&gt; dataVersionsRequest = ns0.DataVersionsRequest_Dec()
  &gt;&gt;&gt; dataVersionsRequest._accountInfo = acctInfo
  &gt;&gt;&gt; service.getDataVersions(dataVersionsRequest)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "AutomotiveDescriptionService6_client.py", line 36, in getDataVersions
      raise TypeError, "%s incorrect request type" % (request.__class__)
  TypeError: &lt;class 'AutomotiveDescriptionService6_types.DataVersionsRequest_Dec'&gt; incorrect request type
  &gt;&gt;&gt; dataVersionsRequest = getDataVersions
  &gt;&gt;&gt; dataVersionsRequest._accountInfo = acctInfo
  &gt;&gt;&gt; service.getDataVersions(dataVersionsRequest)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "AutomotiveDescriptionService6_client.py", line 36, in getDataVersions
      raise TypeError, "%s incorrect request type" % (request.__class__)
  AttributeError: class DataVersionsRequest_Holder has no attribute '__class__'
  &gt;&gt;&gt; quit()
  $cat AutomotiveDescriptionService6_client.py
  .....
  # Locator
  class AutomotiveDescriptionService6Locator:
      AutomotiveDescriptionService6Port_address = "http://platform.chrome.com:80/AutomotiveDescriptionService/AutomotiveDescriptionService6"
      def getAutomotiveDescriptionService6PortAddress(self):
          return AutomotiveDescriptionService6Locator.AutomotiveDescriptionService6Port_address
      def getAutomotiveDescriptionService6Port(self, url=None, **kw):
          return AutomotiveDescriptionService6BindingSOAP(url or AutomotiveDescriptionService6Locator.AutomotiveDescriptionService6Port_address, **kw)
  
  # Methods
  class AutomotiveDescriptionService6BindingSOAP:
      def __init__(self, url, **kw):
          kw.setdefault("readerclass", None)
          kw.setdefault("writerclass", None)
          # no resource properties
          self.binding = client.Binding(url=url, **kw)
          # no ws-addressing
  
      # op: getDataVersions
      def getDataVersions(self, request, **kw):
          if isinstance(request, getDataVersions) is False:
              raise TypeError, "%s incorrect request type" % (request.__class__)
          # no input wsaction
          self.binding.Send(None, None, request, soapaction="", **kw)
          # no output wsaction
          response = self.binding.Receive(getDataVersionsResponse.typecode)
          return response
  .....
  getDataVersions = GED("urn:description6.kp.chrome.com", "DataVersionsRequest").pyclass
  </code></pre>
  
  <p>Also, as an aside, I'm not sure that the strings I'm passing to the pname parameter are correct, I assume that those are the ones I see inside the XML when I explore the service with SOAP UI, right?</p>