title: suds.TypeNotFound: Type not found: 'MerchantCode'
body: <p>I am developing a web using django and it deals with wsdl. I have an example code in dealing with it but its written on PHP and I wanted to convert it to python for my django.
  here is the PHP file ...</p>
  
  <pre><code>&lt;?php
    ini_set("soap.wsdl_cache_enabled", "0");
  
    $WSDL                  = "DirectConnect.test.WSDL";
  
    $MerchantCode          = "HELLO";
    $MerchantReference     = "" . time();
    $TransactionType       = 20;
    $Amount                = 100;
    $CurrencyCode          = "PHP";
    $CardHolderName        = "RAUL O REVECHE";
    $CardNumber            = "4005550000000001";
    $ExpiryMonth           = 5;
    $ExpiryYear            = 2013;
    $CardID                = 0;
    $CardSecurityCode      = "400";
    $CustomerAccountNumber = "";
    $BillNumber            = 0;
    $CardHolderEmail       = "development@yespayments.com.ph";
    $ClientIPAddress       = $_SERVER["REMOTE_ADDR"];
    $Notes                 = "This is a test.";
  
    $SoapClient = new SoapClient($WSDL,array(
      "soap_version" =&gt; SOAP_1_2,
      "features"     =&gt; SOAP_SINGLE_ELEMENT_ARRAYS,
      "cache_wsdl"   =&gt; WSDL_CACHE_NONE,
      "trace"        =&gt; 1,
      "exceptions"   =&gt; 0));
  
    try
    {
      $response = $SoapClient-&gt;OnlineTransaction(array(
        "MerchantCode"          =&gt; $MerchantCode,
        "MerchantReference"     =&gt; $MerchantReference,
        "TransactionType"       =&gt; $TransactionType,
        "Amount"                =&gt; $Amount,
        "CurrencyCode"          =&gt; $CurrencyCode,
        "CardHolderName"        =&gt; $CardHolderName,
        "CardNumber"            =&gt; $CardNumber,
        "ExpiryMonth"           =&gt; $ExpiryMonth,
        "ExpiryYear"            =&gt; $ExpiryYear,
        "CardID"                =&gt; $CardID,
        "CardSecurityCode"      =&gt; $CardSecurityCode,
        "CustomerAccountNumber" =&gt; $CustomerAccountNumber,
        "BillNumber"            =&gt; $BillNumber,
        "CardHolderEmail"       =&gt; $CardHolderEmail,
        "ClientIPAddress"       =&gt; $ClientIPAddress,
        "Notes"                 =&gt; $Notes
        ));
  
      print "&lt;br /&gt;TransactionID: ".            $response-&gt;OnlineTransactionResult-&gt;TransactionID;
      print "&lt;br /&gt;TransactionType: ".          $response-&gt;OnlineTransactionResult-&gt;TransactionType;
      print "&lt;br /&gt;MerchantReference: ".        $response-&gt;OnlineTransactionResult-&gt;MerchantReference;
      print "&lt;br /&gt;ResponseCode: ".             $response-&gt;OnlineTransactionResult-&gt;ResponseCode;
      print "&lt;br /&gt;ResponseShortDescription: ". $response-&gt;OnlineTransactionResult-&gt;ResponseShortDescription;
      print "&lt;br /&gt;ResponseDescription: ".      $response-&gt;OnlineTransactionResult-&gt;ResponseDescription;
      print "&lt;br /&gt;TimeStamp: ".                $response-&gt;OnlineTransactionResult-&gt;TimeStamp;
      print "&lt;br /&gt;CardID: ".                   $response-&gt;OnlineTransactionResult-&gt;CardData-&gt;CardID;
      print "&lt;br /&gt;CardSuffix: ".               $response-&gt;OnlineTransactionResult-&gt;CardData-&gt;CardSuffix;
      print "&lt;br /&gt;ExpiryYear: ".               $response-&gt;OnlineTransactionResult-&gt;CardData-&gt;ExpiryYear;
      print "&lt;br /&gt;ExpiryMonth: ".              $response-&gt;OnlineTransactionResult-&gt;CardData-&gt;ExpiryMonth;
      print "&lt;br /&gt;BINCountryCode: ".           $response-&gt;OnlineTransactionResult-&gt;BINCountryCode;
      print "&lt;br /&gt;IPCountryCode: ".            $response-&gt;OnlineTransactionResult-&gt;IPCountryCode;
      print "&lt;br /&gt;WarningArray: ".             $response-&gt;OnlineTransactionResult-&gt;WarningArray;
  
    }
    catch (SoapFault $exception)
    {
      print $exception;
    }
  
    print "&lt;br /&gt;&lt;br /&gt;Request:&lt;br /&gt;". htmlspecialchars($SoapClient-&gt;__getLastRequest());
    print "&lt;br /&gt;&lt;br /&gt;Response:&lt;br /&gt;". htmlspecialchars($SoapClient-&gt;__getLastResponse());
  
  ?&gt;
  </code></pre>
  
  <p>and this is what i have done to converting it to python...</p>
  
  <pre><code>from suds.client import Client
  import collections
  url = 'file:///home/myFile/DirectConnect.test.WSDL'
  client = Client(url)
  values = collections.OrderedDict([
              ("MerchantCode", "HELLO"),
              ("MerchantReference", ""),
              ("TransactionType",20),
              ("Amount",100),
              ("CurrencyCode","PHP"),
              ("CardHolderName","RAUL O REVECHE"),
              ("CardNumber", "4005550000000001"),
              ("ExpiryMonth",5),
              ("ExpiryYear",2013),
              ("CardID",0),
              ("CardSecurityCode","400"),
              ("CustomerAccountNumber",""),
              ("BillNumber",0),
              ("CardHolderEmail","development@yespayments.com.ph"),
              ("ClientIPAddress","http://127.0.0.1:8000/"),
              ("Notes","This is test"),
              ])
  
  response = client.service.OnlineTransaction(values)
  </code></pre>
  
  <p>but when i run it, i got this error...</p>
  
  <pre><code>Traceback (most recent call last):
    File "yes_test.py", line 24, in &lt;module&gt;
      response = client.service.OnlineTransaction(values)
    File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 542, in __call__
      return client.invoke(args, kwargs)
    File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 595, in invoke
      soapenv = binding.get_message(self.method, args, kwargs)
    File "/usr/local/lib/python2.7/dist-packages/suds/bindings/binding.py", line 120, in get_message
      content = self.bodycontent(method, args, kwargs)
    File "/usr/local/lib/python2.7/dist-packages/suds/bindings/document.py", line 63, in bodycontent
      p = self.mkparam(method, pd, value)
    File "/usr/local/lib/python2.7/dist-packages/suds/bindings/document.py", line 105, in mkparam
      return Binding.mkparam(self, method, pdef, object)
    File "/usr/local/lib/python2.7/dist-packages/suds/bindings/binding.py", line 287, in mkparam
      return marshaller.process(content)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/core.py", line 62, in process
      self.append(document, content)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/core.py", line 75, in append
      self.appender.append(parent, content)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/appender.py", line 102, in append
      appender.append(parent, content)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/appender.py", line 243, in append
      Appender.append(self, child, cont)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/appender.py", line 182, in append
      self.marshaller.append(parent, content)
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/core.py", line 74, in append
      if self.start(content):
    File "/usr/local/lib/python2.7/dist-packages/suds/mx/literal.py", line 87, in start
      raise TypeNotFound(content.tag)
  suds.TypeNotFound: Type not found: 'MerchantCode'
  </code></pre>
  
  <p>i think that the error is in these line of my python,</p>
  
  <pre><code>response = client.service.OnlineTransaction(values)
  </code></pre>
  
  <p>can anyone can give me an idea about my situation?</p>
  
  <p>thanks in advance ...</p>