4
votes

I want to consume data from WSDL url, I don't know how would I do in python.

Can anyone help me with the example

here is the WSDL link for reference : http://43.242.214.173/cwplservice/cwplonline.svc?wsdl

Here is code snippet which I have tried.

from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor

url = 'http://43.242.214.173/cwplservice/cwplonline.svc?wsdl' 
imp = Import('http://212.235.42.50/WebService/service.php?class=masterPricer', location='https://www.w3.org/2001/XMLSchema.xsd') 
imp.filter.add('http://www.w3.org/2001/XMLSchema')
client = Client(url, doctor=ImportDoctor(imp))
print client

when I run the code I am getting following error as suds.TypeNotFound: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )'

1

1 Answers

0
votes

Did you looked into PySimpleSOAP? I've used it, it is pretty good for making SOAP calls and parsing small size XML responses. For very large XML message responses it has crashed on me, ended up writing my own XML handler using xml.etree.ElemenTree.

https://pypi.python.org/pypi/PySimpleSOAP/1.02b