Slow client creation times may also point to external imports that take time to resolve, load, parse, or connect to. I would run a packet capture while you instantiate your client so you can see exactly what may be going on. I've loaded some fairly large WSDLs and it's never taken it a minute...<br>
<br><div class="gmail_quote">On Wed, Sep 21, 2011 at 12:06 PM, Joshua J. Kugler <span dir="ltr"><<a href="mailto:joshua@eeinternet.com">joshua@eeinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Wednesday, September 21, 2011, Craig Kost elucidated thus:<br>
<div class="im">> Hello,<br>
><br>
> Python 2.7.1<br>
> Suds 0.4<br>
> Windows XP SP3<br>
><br>
> I have been using the suds client (suds.client.Client) for testing<br>
> some SOAP interfaces and I have recently come across some<br>
> unpredictable behaviour.<br>
><br>
</div>> Basically what is happening is I am *sometimes (more often than not)*<br>
<div class="im">> unable to create a client from WSDL source.<br>
><br>
> I guess an example would better shed light on what I mean.<br>
><br>
> For example I run the following<br>
><br>
> >>> from suds.client import Client<br>
> >>> client = Client("<a href="http://localhost:8000/sms/soap/?wsdl" target="_blank">http://localhost:8000/sms/soap/?wsdl</a>")<br>
><br>
> and I get this traceback<br>
</div><snip><br>
<div class="im">> File "C:\Python27\lib\urllib2.py", line 1157, in do_open<br>
> r = h.getresponse(buffering=True)<br>
> File "C:\Python27\lib\httplib.py", line 1013, in getresponse<br>
> response.begin()<br>
> File "C:\Python27\lib\httplib.py", line 402, in begin<br>
> version, status, reason = self._read_status()<br>
> File "C:\Python27\lib\httplib.py", line 366, in _read_status<br>
> raise BadStatusLine(line)<br>
> BadStatusLine: ''<br>
><br>
</div>> I can later call* the same* client creation code and successfully<br>
> create a usable client.<br>
<br>
Since the error is being raised in httplib, it would seem your web<br>
server is not responding correctly (bad status line). I would try doing<br>
several test calls with just httplib (or urllib2) against this same URL<br>
and see if you can replicate the error.<br>
<div class="im"><br>
> One last thing. Is there anyway to speed up the creation of the<br>
> clients. Sometimes for a simple WSDL it takes up to 1 minute to<br>
> create a client...<br>
<br>
</div>Define "simple." :) I've used some pretty complex WSDL files, and it's<br>
never taken as long as a minute. The Sax parser is pure python, so it<br>
might not be the fastest thing out there. Also, look into the caching<br>
options.<br>
<br>
j<br>
<font color="#888888"><br>
--<br>
Joshua Kugler<br>
Part-Time System Admin/Programmer<br>
<a href="http://www.eeinternet.com" target="_blank">http://www.eeinternet.com</a> - Fairbanks, AK<br>
PGP Key: <a href="http://pgp.mit.edu/" target="_blank">http://pgp.mit.edu/</a> ID 0x73B13B6A<br>
_______________________________________________<br>
suds mailing list<br>
<a href="mailto:suds@lists.fedoraproject.org">suds@lists.fedoraproject.org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/suds" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/suds</a><br>
</font></blockquote></div><br>