Hey Rob,
You're on the right track. The problem is that the schema references a type defined
in
the schema
but does not import it.
This is a
fairly common mistake made by the wsdl writer.
This will fix it:
from suds.xsd.doctor import ImportDoctor, Import
url = 'http://ws.tramtracker.com.au/pidsservice/pids.asmx?WSDL'
imp =
# the schema to import.
# the schema to import into.
d = ImportDoctor(imp)
client = Client(url, doctor=d)
If using suds <= 0.3.9
You may need to clear the suds cache. On linux: 'rm -f /tmp/suds/*'
Or,
client = Client(url, doctor=d, cache=None)
Hope this helps,
Jeff
On 09/09/2010 11:24 PM, Rob D wrote:
Hey guys, I've been trying to get suds working but am currently
getting
this error:
from suds.client import Client
url='http://ws.tramtracker.com.au/pidsservice/pids.asmx?WSDL'
client = Client(url)
robzy@cookiemonster:/mnt/storage/YarraTrams$ python test.py
Traceback (most recent call last):
File "test.py", line 22, in <module>
client = Client(url)
File "build/bdist.linux-i686/egg/suds/client.py", line 112, in __init__
File "build/bdist.linux-i686/egg/suds/reader.py", line 152, in open
File "build/bdist.linux-i686/egg/suds/wsdl.py", line 159, in __init__
File "build/bdist.linux-i686/egg/suds/wsdl.py", line 220, in
build_schema
File "build/bdist.linux-i686/egg/suds/xsd/schema.py", line 95, in load
File "build/bdist.linux-i686/egg/suds/xsd/schema.py", line 323, in
dereference
File "build/bdist.linux-i686/egg/suds/xsd/sxbasic.py", line 422, in
dependencies
suds.TypeNotFound: Type not found: '(schema,
http://www.w3.org/2001/XMLSchema, )'
robzy@cookiemonster:/mnt/storage/YarraTrams$
Unfortunately I don't really know enough about XML to properly diagnose
the problem, but my Googling suggests that the Doctor(?) object would be
the way to fix it. Unfortunately, I have failed in finding documentation
that is sufficient given my small amount of understanding. Would anyone
have any suggestions?
For reference, the WSDL can be seen at
http://pastebin.com/K0PVD0DK
Thanks,
Rob.
_______________________________________________
suds mailing list
suds(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/suds