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
Traceback (most recent call last): File "<pyshell#15>", line 1, in <module> client = Client("http://localhost:8000/sms/soap/?wsdl") File "build\bdist.win32\egg\suds\client.py", line 112, in __init__ self.wsdl = reader.open(url) File "build\bdist.win32\egg\suds\reader.py", line 152, in open d = self.fn(url, self.options) File "build\bdist.win32\egg\suds\wsdl.py", line 159, in __init__ self.build_schema() File "build\bdist.win32\egg\suds\wsdl.py", line 220, in build_schema self.schema = container.load(self.options) File "build\bdist.win32\egg\suds\xsd\schema.py", line 93, in load child.open_imports(options) File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports imported = imp.open(options) File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open result = self.download(options) File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 563, in download return self.schema.instance(root, url, options) File "build\bdist.win32\egg\suds\xsd\schema.py", line 397, in instance return Schema(root, baseurl, options) File "build\bdist.win32\egg\suds\xsd\schema.py", line 226, in __init__ self.open_imports(options) File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports imported = imp.open(options) File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open result = self.download(options) File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 560, in download d = reader.open(url) File "build\bdist.win32\egg\suds\reader.py", line 79, in open d = self.download(url) File "build\bdist.win32\egg\suds\reader.py", line 95, in download fp = self.options.transport.open(Request(url)) File "build\bdist.win32\egg\suds\transport\https.py", line 60, in open return HttpTransport.open(self, request) File "build\bdist.win32\egg\suds\transport\http.py", line 62, in open return self.u2open(u2request) File "build\bdist.win32\egg\suds\transport\http.py", line 118, in u2open return url.open(u2request, timeout=tm) File "C:\Python27\lib\urllib2.py", line 392, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 410, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 370, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 1186, in http_open return self.do_open(httplib.HTTPConnection, req) 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.
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...
Thanks, Craig
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
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...
On Wed, Sep 21, 2011 at 12:06 PM, Joshua J. Kugler joshua@eeinternet.comwrote:
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 _______________________________________________ suds mailing list suds@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/suds