python suds error with company proxy


#1

I’m just starting with FlightXML2 with Python suds and having trouble. I suspect I’m not connecting properly due to the company proxy but I don’t know where to start debugging. Please help me with some suggestions. Thanks.

ERROR:
ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0=“http://flightxml.flightaware.com/soap/FlightXML2” xmlns:ns1=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”>
SOAP-ENV:Header/
ns1:Body
ns0:AirportInfoRequest
ns0:airportCodeKBOS</ns0:airportCode>
</ns0:AirportInfoRequest>
</ns1:Body>
</SOAP-ENV:Envelope>

CODE:
import sys
from suds import null, WebFault
from suds.client import Client
import logging

username = 'xx’
apiKey = 'xx’
url = 'http://flightxml.flightaware.com/soap/FlightXML2/wsdl
utrc_proxy = dict(http = ‘http://user:password@proxy:8080’)

logging.basicConfig(level=logging.INFO)

api = Client(url, username=username, password=apiKey, proxy=utrc_proxy)
print api

A = api.service.AirportInfo(“KBOS”)
print A


#2

What’s the actual error message from suds? You’ve only included the raw dump of the SOAP request body.


#3

Here is the suds error. Thanks for your interest.

Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\georgera\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py”, line 541, in runfile
execfile(filename, namespace)
File “C:/Research/BDA/code/apiTestSuds.py”, line 26, in
A = api.service.AirportInfo(“KBOS”)
File “C:\Users\georgera\AppData\Local\Continuum\Anaconda\lib\site-packages\suds-0.4-py2.7.egg\suds\client.py”, line 542, in call
return client.invoke(args, kwargs)
File “C:\Users\georgera\AppData\Local\Continuum\Anaconda\lib\site-packages\suds-0.4-py2.7.egg\suds\client.py”, line 602, in invoke
result = self.send(soapenv)
File “C:\Users\georgera\AppData\Local\Continuum\Anaconda\lib\site-packages\suds-0.4-py2.7.egg\suds\client.py”, line 649, in send
result = self.failed(binding, e)
File “C:\Users\georgera\AppData\Local\Continuum\Anaconda\lib\site-packages\suds-0.4-py2.7.egg\suds\client.py”, line 698, in failed
reply = error.fp.read()
AttributeError: ‘NoneType’ object has no attribute ‘read’