In [3]:
from suds.client import Client

In [158]:
url = 'http://www.webservicex.net/MortgageIndex.asmx?WSDL'
client = Client(url)

In [159]:
def GenerateMethods(client):
    methodInputList = []
    methodInputDict = {}


    for method in client.wsdl.services[0].ports[0].methods.values():
        methodInputDict["name"]= method.name
        methodInputDict["inputs"]=[]
        for part in method.soap.input.body.parts:
            methodInputDict["inputs"].append(client.factory.create(part.element[0]))
        #print '%s(%s)' % (method.name, ', '.join('%s' % (client.factory.create(part.element[0])) for part in method.soap.input.body.parts))
        #print "\n\n\n\n"
        methodInputList.append(methodInputDict)
        methodInputDict = {}
    return methodInputList
    
    

methods =  GenerateMethods(client)  

for method in methods:
    print "Method: %s , Input %s"%(method["name"],method["inputs"])


Method: GetCurrentMortgageIndexMonthly , Input <empty>
Method: GetMortgageIndexByMonth , Input (GetMortgageIndexByMonth){
   Month = None
   Year = None
 }
Method: GetCurrentMortgageIndexByWeekly , Input <empty>
Method: GetMortgageIndexByWeek , Input (GetMortgageIndexByWeek){
   Day = None
   Month = None
   Year = None
 }

In [141]:
tmp = methodInputList[-1]
for k,v in tmp['inputs'][-1]:
    k=1
print tmp


{'inputs': [(LastExecution){
   Symbol = None
   NumberOfRecords = None
 }], 'name': LastExecution}

In [ ]: