title: Python and PHP SOAP server
body: <p>I trying to use the SOAP service based on "PHP SOAP server". And I have a problem with the argument passing. When it's a scalar argument, all is OK, but when I try to pass the structure there is a failure. Python libraries create arrays in the different format. In this example I'm using the SUDS but the other libraries don't makes "right format" too.</p>
  
  <p>Service WSDL: <code>http://www.drebedengi.ru/soap/dd.wsdl</code></p>
  
  <p>PHP query:
  </p>
  
  <pre><code>$client = new SoapClient('http://www.drebedengi.ru/soap/dd.wsdl', array("trace" =&gt; 1));    
  $client-&gt;getRecordList(
                  'demo_api',
                  'demo@example.com',
                  'demo',
                  array(
                       'is_report' =&gt; false,
                       'is_show_duty' =&gt; true,
                       'r_period' =&gt; 8,
                       'r_how' =&gt; 1,
                       'r_what' =&gt; 6,
                       'r_currency' =&gt; 0,
                       'r_is_place' =&gt; 0,
                       'r_is_tag' =&gt; 0,
                  )
              )
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ddengi"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
          &lt;SOAP-ENV:Body&gt;
              &lt;ns1:getRecordList&gt;
                  &lt;apiId xsi:type="xsd:string"&gt;demo_api&lt;/apiId&gt;
                  &lt;login xsi:type="xsd:string"&gt;demo@example.com&lt;/login&gt;
                  &lt;pass xsi:type="xsd:string"&gt;demo&lt;/pass&gt;
                  &lt;params xsi:type="ns2:Map"&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;is_report&lt;/key&gt;
                          &lt;value xsi:type="xsd:boolean"&gt;false&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;is_show_duty&lt;/key&gt;
                          &lt;value xsi:type="xsd:boolean"&gt;true&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_period&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;8&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_how&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;1&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_what&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;6&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_currency&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;0&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_is_place&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;0&lt;/value&gt;
                      &lt;/item&gt;
                      &lt;item&gt;
                          &lt;key xsi:type="xsd:string"&gt;r_is_tag&lt;/key&gt;
                          &lt;value xsi:type="xsd:int"&gt;0&lt;/value&gt;
                      &lt;/item&gt;
                  &lt;/params&gt;
                  &lt;idList xsi:nil="true" /&gt;
              &lt;/ns1:getRecordList&gt;
          &lt;/SOAP-ENV:Body&gt;
      &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Python query with SUDS:</p>
  
  <pre class="lang-py prettyprint-override"><code>client = suds.client.Client("http://www.drebedengi.ru/soap/dd.wsdl")
  params = {
      "is_report": False,
      "is_show_duty": True,
      "r_period": 8,
      "r_how": 1,
      "r_what": 6,
      "r_currency": 0,
      "r_is_place": 0,
      "r_is_tag": 0
  }
  print client.service.getRecordList("demo_api", "demo@example.com", "demo", params)
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="urn:ddengi" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;SOAP-ENV:Header/&gt;
     &lt;ns1:Body&gt;
        &lt;ns4:getRecordList&gt;
           &lt;apiId xsi:type="ns2:string"&gt;demo_api&lt;/apiId&gt;
           &lt;login xsi:type="ns2:string"&gt;demo@example.com&lt;/login&gt;
           &lt;pass xsi:type="ns2:string"&gt;demo&lt;/pass&gt;
           &lt;params xsi:type="ns0:params"&gt;
              &lt;is_report xsi:type="ns2:boolean"&gt;False&lt;/is_report&gt;
              &lt;r_how xsi:type="ns2:int"&gt;1&lt;/r_how&gt;
              &lt;r_currency xsi:type="ns2:int"&gt;0&lt;/r_currency&gt;
              &lt;is_show_duty xsi:type="ns2:boolean"&gt;True&lt;/is_show_duty&gt;
              &lt;r_is_tag xsi:type="ns2:int"&gt;0&lt;/r_is_tag&gt;
              &lt;r_is_place xsi:type="ns2:int"&gt;0&lt;/r_is_place&gt;
              &lt;r_what xsi:type="ns2:int"&gt;6&lt;/r_what&gt;
              &lt;r_period xsi:type="ns2:int"&gt;8&lt;/r_period&gt;
           &lt;/params&gt;
        &lt;/ns4:getRecordList&gt;
     &lt;/ns1:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>I tried to use <code>client.factory.create()</code> but it doesn't work: types list is empty. There is the output of <code>print client</code>:</p>
  
  <pre>
  Suds ( https://fedorahosted.org/suds/ )  version: 0.4 GA  build: R699-20100913
  
  Service ( ddengiService ) tns="urn:ddengi"
     Prefixes (0)
     Ports (1):
        (SoapPort)
           Methods (28):
              deleteAll(xs:string apiId, xs:string login, xs:string pass, )
              deleteObject(xs:string apiId, xs:string login, xs:string pass, xs:integer id, xs:string type, )
              getAccessStatus(xs:string apiId, xs:string login, xs:string pass, )
              getAccumList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getBalance(xs:string apiId, xs:string login, xs:string pass, xs:anyType params, )
              getCategoryList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getChangeList(xs:string apiId, xs:string login, xs:string pass, xs:string revision, )
              getCurrencyList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getCurrentRevision(xs:string apiId, xs:string login, xs:string pass, )
              getExpireDate(xs:string apiId, xs:string login, xs:string pass, )
              getOrderList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getPlaceList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getRecordList(xs:string apiId, xs:string login, xs:string pass, xs:anyType params, xs:anyType idList, )
              getRightAccess(xs:string apiId, xs:string login, xs:string pass, )
              getServerSubs(xs:string url, )
              getSourceList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getSubscriptionStatus(xs:string apiId, xs:string login, xs:string pass, )
              getTagList(xs:string apiId, xs:string login, xs:string pass, xs:anyType idList, )
              getUserIdByLogin(xs:string apiId, xs:string login, xs:string pass, )
              setAccumList(xs:string apiId, xs:string login, xs:string pass, xs:string list, )
              setCategoryList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              setCurrencyList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              setPaymentTransaction(xs:string apiId, xs:string login, xs:string pass, xs:string transactionReceipt, xs:string amount, )
              setPlaceList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              setRecordList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              setSourceList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              setTagList(xs:string apiId, xs:string login, xs:string pass, xs:anyType list, )
              userRegister(xs:string apiId, xs:string login, xs:string name, xs:string lang, )
           Types (0):
  </pre>