fails when connecting to https wsdl files

Bug #942478 reported by Alan Bell
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zsi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

trying to create python wrapper for https://secure.eloqua.com/API/1.2/service.svc?wsdl
it can retrieve that URL, but the schema includes imports for other https locations e.g.
<xsd:import schemaLocation="https://secure.eloqua.com/API/1.2/service.svc?xsd=xsd0" namespace="https://secure.eloqua.com/API/1.2"/>

this falls over with
Error loading https://secure.eloqua.com/API/1.2/service.svc?wsdl:
 sendall
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ZSI/generate/commands.py", line 135, in wsdl2py
    wsdl = load(location)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/WSDLTools.py", line 39, in loadFromURL
    document = DOM.loadFromURL(url)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/Utility.py", line 642, in loadFromURL
    file = urlopen(url)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/Utility.py", line 180, in urlopen
    conn.endheaders()
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 790, in send
    self.sock.sendall(data)
AttributeError: sendall

and if I download that wsdl and try from a file I get:

Error loading eloqua.wsdl:
 sendall
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ZSI/generate/commands.py", line 135, in wsdl2py
    wsdl = load(location)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/WSDLTools.py", line 53, in loadFromFile
    wsdl = self.loadFromStream(file)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/WSDLTools.py", line 34, in loadFromStream
    wsdl.load(document)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/WSDLTools.py", line 286, in load
    schema = reader.loadFromNode(WSDLToolsAdapter(self), item)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/XMLSchema.py", line 102, in loadFromNode
    schema.load(reader)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/XMLSchema.py", line 1213, in load
    tp.loadSchema(schema)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/XMLSchema.py", line 1363, in loadSchema
    reader.loadFromURL(self.attributes.get('schemaLocation'), schema)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/XMLSchema.py", line 135, in loadFromURL
    reader.loadFromURL(url)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/XMLSchema.py", line 297, in loadFromURL
    self.__node = DOM.loadFromURL(url)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/Utility.py", line 643, in loadFromURL
    file = urlopen(url)
  File "/usr/lib/pymodules/python2.7/ZSI/wstools/Utility.py", line 181, in urlopen
    conn.endheaders()
  File "/usr/lib/python2.7/httplib.py", line 955, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 815, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.sock.sendall(data)

I managed to fix it by changing line 641 of /usr/lib/pymodules/python2.7/ZSI/wstools/Utility.py to
            file = urllib.urlopen(url)
which means it uses the standard urllib function rather than the one it wraps to add timeouts.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-zsi 2.1~a1-3 [modified: usr/share/pyshared/ZSI/wstools/Utility.py]
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic 3.2.6
Uname: Linux 3.2.0-17-generic x86_64
ApportVersion: 1.93-0ubuntu2
Architecture: amd64
Date: Tue Feb 28 09:21:12 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120217)
PackageArchitecture: all
SourcePackage: zsi
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Alan Bell (alanbell) wrote :
Revision history for this message
sajuptpm (sajuptpm) wrote :

I also got same error and fixed by changing
file = urlopen(url) to file = urllib.urlopen(url)

in ZSI-2.0_rc3-py2.7.egg/ZSI/wstools/Utility.py line number 637

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zsi (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.