0

When I try to load http://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl the exception Type not found: '(IPAddressFilter, http://www.onvif.org/ver10/schema/onvif.xsd, )' raises. Is it possible to fix?

from suds.client import Client
client = Client('file:///home/web/www/wsdl/devicemgmt.wsdl')

P.S. WSDL file changed by me, just added direct link to the http://www.onvif.org/ver10/schema/onvif.xsd in the start of the file.

P.P.S

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 119, in __init__
    sd = ServiceDefinition(self.wsdl, s)
  File "/usr/local/lib/python2.7/dist-packages/suds/servicedefinition.py", line 58, in __init__
    self.paramtypes()
  File "/usr/local/lib/python2.7/dist-packages/suds/servicedefinition.py", line 137, in paramtypes
    item = (pd[1], pd[1].resolve())
  File "/usr/local/lib/python2.7/dist-packages/suds/xsd/sxbasic.py", line 63, in resolve
    raise TypeNotFound(qref)
suds.TypeNotFound: Type not found: '(IPAddressFilter, http://www.onvif.org/ver10/schema/onvif.xsd, )'
Kin
  • 4,466
  • 13
  • 54
  • 106

1 Answers1

0

Try adding schema to import.

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

imp = Import('http://www.w3.org/2001/XMLSchema')      # the schema to import.
imp.filter.add('http://www.onvif.org/ver10/schema')   # the schema to import into.
d = ImportDoctor(imp)
s = Client("http://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl", doctor = d)
dexter
  • 141
  • 3
  • may be you know how also i could add service tag on the fly? – Kin Aug 06 '14 at 07:37
  • @Kin not sure what you mean. where do you want to add tag? – dexter Aug 06 '14 at 08:05
  • When you try to run some service, for example `GetDeviceInformation` it raises the exception `Exception: No services defined`. Service tag looks like this `` and show us target device where request should be send. Currently I adding it by hand – Kin Aug 06 '14 at 08:11
  • have you looked at Client.wsdl.add_children() method? – dexter Aug 06 '14 at 10:06
  • noupe, there is not so good description of suds... Could you give a link for description or examples? – Kin Aug 08 '14 at 11:54