Getting HTTP Error 405: Method Not Allowed


I’m trying to request airline info and getting HTTP Error 405: Method Not Allowed exception.
My python code as follows:

#!/usr/bin/env python3

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

wsdlFile = ''
api = Client(wsdlFile, username=username, password=apiKey)
airline_info = api.service.AirlineInfo('AFL')

Error I'm getting:

ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsi="" xmlns:ns0="" xmlns:ns1="">
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/suds/transport/", line 78, in send
    fp = self.u2open(u2request)
  File "/usr/local/lib/python3.7/site-packages/suds/transport/", line 119, in u2open
    return, timeout=tm)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 405: Method Not Allowed

Could some one help me with this issue?


It looks like this error may be specific to the suds-py3 package. Using the more up-to-date suds-jurko package instead allows for requests to work properly without any other code changes to your example.