<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hello all,<div>  I have an OTA (open travel alliance) WSDL that I am trying to call.  When trying with a Suds implementation it works but uses >1.5 gigs of RAM to initialize the client object. If anyone knows how to get an order of magnitude shrinkage in Suds clients then please let me know and we can ignore what follows.</div><div><br></div><div>I'm trying to see how well PySimpleSoap might serve as a replacement but I seem to have hit a limitation.</div><div><br></div><div>The relevant imported XSDs (OTA_CommonTypes, OTA_SimpleTypes) for the WSDL declares (apologies in advance if the formatting screws up plain text readers - I worked on the assumption that the added clarity outweighed the increasingly rare case):</div><div><div><pre style="color:rgb(88,110,117);font-family:Menlo;font-size:12pt;background-color:rgb(253,246,227)"><span style="color:rgb(147,161,161)"><</span><span style="color:rgb(38,139,210);font-weight:bold">xs:complexType </span><span style="color:rgb(147,161,161)">name</span><span style="color:rgb(42,161,152)">="CountryNameType"</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">      <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation </span><span style="color:rgb(108,113,196)">xml</span><span style="color:rgb(147,161,161)">:lang</span><span style="color:rgb(42,161,152)">="en"</span><span style="color:rgb(147,161,161)">></span>The name or code of a country (e.g. as used in an address or to specify citizenship of a traveller).<span style="color:rgb(147,161,161)"></</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   </</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   <</span><span style="color:rgb(38,139,210);font-weight:bold">xs:simpleContent</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">      <</span><span style="color:rgb(38,139,210);font-weight:bold">xs:extension </span><span style="color:rgb(147,161,161)">base</span><span style="color:rgb(42,161,152)">="StringLength0to64"</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">         <</span><span style="color:rgb(38,139,210);font-weight:bold">xs:attribute </span><span style="color:rgb(147,161,161)">name</span><span style="color:rgb(42,161,152)">="Code" </span><span style="color:rgb(147,161,161)">type</span><span style="color:rgb(42,161,152)">="ISO3166" </span><span style="color:rgb(147,161,161)">use</span><span style="color:rgb(42,161,152)">="optional"</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">            <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">               <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation </span><span style="color:rgb(108,113,196)">xml</span><span style="color:rgb(147,161,161)">:lang</span><span style="color:rgb(42,161,152)">="en"</span><span style="color:rgb(147,161,161)">></span>ISO 3166 code for a country.<span style="color:rgb(147,161,161)"></</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">            </</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">         </</span><span style="color:rgb(38,139,210);font-weight:bold">xs:attribute</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">      </</span><span style="color:rgb(38,139,210);font-weight:bold">xs:extension</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   </</span><span style="color:rgb(38,139,210);font-weight:bold">xs:simpleContent</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)"></</span><span style="color:rgb(38,139,210);font-weight:bold">xs:complexType</span><span style="color:rgb(147,161,161)">><br></span></pre></div></div><div>and</div><div><div><pre style="color:rgb(88,110,117);font-family:Menlo;font-size:12pt;background-color:rgb(253,246,227)"><span style="color:rgb(147,161,161)"><</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:simpleType </span><span style="color:rgb(147,161,161)">name</span><span style="color:rgb(42,161,152)">="StringLength0to64"</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">      <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation </span><span style="color:rgb(108,113,196)">xml</span><span style="color:rgb(147,161,161)">:lang</span><span style="color:rgb(42,161,152)">="en"</span><span style="color:rgb(147,161,161)">></span>Used for Character Strings, length 0 to 64<span style="color:rgb(147,161,161)"></</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:documentation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   </</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:annotation</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">   <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:restriction </span><span style="color:rgb(147,161,161)">base</span><span style="color:rgb(42,161,152)">="xs:string"</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)">      <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:minLength </span><span style="color:rgb(147,161,161)">value</span><span style="color:rgb(42,161,152)">="0"</span><span style="color:rgb(147,161,161)">/><br></span><span style="color:rgb(147,161,161)">      <</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:maxLength </span><span style="color:rgb(147,161,161)">value</span><span style="color:rgb(42,161,152)">="64"</span><span style="color:rgb(147,161,161)">/><br></span><span style="color:rgb(147,161,161)">   </</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:restriction</span><span style="color:rgb(147,161,161)">><br></span><span style="color:rgb(147,161,161)"></</span><span style="color:rgb(108,113,196);font-weight:bold">xs</span><span style="color:rgb(38,139,210);font-weight:bold">:simpleType</span><span style="color:rgb(147,161,161)">><br></span></pre></div></div><div>When parsing this I get an error:<br></div><div><br></div><div><div><font face="monospace, monospace">File "{path}/lib/python2.7/site-packages/pysimplesoap/helpers.py", line 271, in process_element</font></div><div><font face="monospace, monospace">    struct.refers_to = fn</font></div><div><font face="monospace, monospace">TypeError: can't set attributes of built-in/extension type 'str'</font></div></div><div><br></div><div>which occurs in a recursive call to process_element after this chunk:</div><div><pre style="color:rgb(88,110,117);font-family:Menlo;font-size:12pt;background-color:rgb(253,246,227)"><span style="color:rgb(133,153,0)">if </span>e <span style="color:rgb(133,153,0)">is not </span><span style="color:rgb(38,139,210)">None </span><span style="color:rgb(133,153,0)">and </span>e.get_local_name() == <span style="color:rgb(61,128,128);font-weight:bold">'extension' </span><span style="color:rgb(133,153,0)">and </span>e.children():<br>    <span style="color:rgb(147,161,161);font-style:italic"># extend base element (if ComplexContent only!):<br></span><span style="color:rgb(147,161,161);font-style:italic">    </span><span style="color:rgb(133,153,0)">if </span><span style="color:rgb(38,139,210)">isinstance</span>(fn, Struct) <span style="color:rgb(133,153,0)">and </span>fn.refers_to:<br>        base_struct = fn.refers_to<br>    <span style="color:rgb(133,153,0)">else</span>:<br>        <span style="color:rgb(147,161,161);font-style:italic"># </span><span style="color:rgb(38,139,210);font-style:italic">TODO: check if this actually works for SimpleContent<br></span><span style="color:rgb(38,139,210);font-style:italic">        </span>base_struct = <span style="color:rgb(38,139,210)">None<br></span></pre></div><div><br></div><div>So I am guessing that the answer to the TODO is "No".</div><div><br></div><div>Has anyone encountered this kind of error before and determined a way around it?</div><div><br></div><div>Cheers,</div><div>Chris</div><span class="HOEnZb"><font color="#888888"><div><div><span style="color:rgb(34,34,34)">-- </span><br></div></div></font></span></div></div><div class="gmail_signature"><div dir="ltr">Christopher Beck<div><a href="mailto:cbeck@railkey.net" target="_blank">cbeck@railkey.net</a></div><div>+1.514.431.7759</div></div></div>
</div>