Skip to content Skip to sidebar Skip to footer

Sending A Soap Request From Python

I'm trying to send a soap request using the suds python package as below: from suds.client import Client WSDL_URL = 'file:/home/Documents/soap/getttt.wsdl' client = Client(WSDL_URL

Solution 1:

If I just use strings as parameters, it complains about the parameter and says

urllib2.URLError: <urlopen error [Errno 111] Connection refused>

Looking at:

<xs:complexTypename="T_GET_TTT"><xs:attributename="HES_ID"type="com:hesHesID"use="required"/><xs:attributename="TTT_ID"type="xs:string"use="required"/><xs:attributename="VERSION_DATE"type="xs:date"use="required"/><xs:attributename="ACC"type="xs:hexBinary"use="required"/></xs:complexType>

then I decided to use the proper type imported form the xml schema using the doctor:

imp = Import('http://www.w3.org/2001/XMLSchema')
d = ImportDoctor(imp)
imp.filter.add('http://aa')
client = Client(WSDL_URL, cache=None, doctor=d)
print client
client.factory.create('xs:string')

my print command shows that I have the xs:string type: but I get this error:

Exception: prefix (xs) not resolved

Any ideas why it thinks that xs is not a prefix but rather part of the type name?

Post a Comment for "Sending A Soap Request From Python"