[Fedora-suds-list] Sporadic Client Creation

Craig Kost kostbot at gmail.com
Wed Sep 21 08:53:26 UTC 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/suds/attachments/20110921/e2129676/attachment.html 


More information about the suds mailing list