[Fedora-suds-list] Sporadic Client Creation
Joshua J. Kugler
joshua at eeinternet.com
Wed Sep 21 16:06:36 UTC 2011
On Wednesday, September 21, 2011, Craig Kost elucidated thus:
> Hello,
>
> Python 2.7.1
> Suds 0.4
> Windows XP SP3
>
> I have been using the suds client (suds.client.Client) for testing
> some SOAP interfaces and I have recently come across some
> unpredictable behaviour.
>
> Basically what is happening is I am *sometimes (more often than not)*
> unable to create a client from WSDL source.
>
> I guess an example would better shed light on what I mean.
>
> For example I run the following
>
> >>> from suds.client import Client
> >>> client = Client("http://localhost:8000/sms/soap/?wsdl")
>
> and I get this traceback
<snip>
> File "C:\Python27\lib\urllib2.py", line 1157, in do_open
> r = h.getresponse(buffering=True)
> File "C:\Python27\lib\httplib.py", line 1013, in getresponse
> response.begin()
> File "C:\Python27\lib\httplib.py", line 402, in begin
> version, status, reason = self._read_status()
> File "C:\Python27\lib\httplib.py", line 366, in _read_status
> raise BadStatusLine(line)
> BadStatusLine: ''
>
> I can later call* the same* client creation code and successfully
> create a usable client.
Since the error is being raised in httplib, it would seem your web
server is not responding correctly (bad status line). I would try doing
several test calls with just httplib (or urllib2) against this same URL
and see if you can replicate the error.
> One last thing. Is there anyway to speed up the creation of the
> clients. Sometimes for a simple WSDL it takes up to 1 minute to
> create a client...
Define "simple." :) I've used some pretty complex WSDL files, and it's
never taken as long as a minute. The Sax parser is pure python, so it
might not be the fastest thing out there. Also, look into the caching
options.
j
--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com - Fairbanks, AK
PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A
More information about the suds
mailing list