[Fedora-suds-list] Problem with WSDL and 0.3.6 version
Jeff Ortel
jortel at redhat.com
Wed Jul 8 15:11:27 UTC 2009
Hey Rudi,
Glad to have you as a suds user.
WSDL-A = (tns="http://impl.search.webservices.core.gids.nl/",
location="https://webservices.gids2.nl/GidsV2Core/zoekservice?wsdl")
WSDL-B = (tns="http://search.webservices.core.gids.nl/",
location="https://webservices.gids2.nl/GidsV2Core/zoekservice?wsdl=zoekservice.wsdl")
WSDL-A imports WSDL-B which defines (9) schemas. WSDL-B is broken and I'm not sure how
0.3.4 loaded it :) Anyway, the problem is that the ninth schema (
tns="http://search.webservices.core.gids.nl/" ) defines an element:
<xsd:element name="GidsException" type="ns2:GidsException"/>
which references the complex type "GitsException" but fails to import the
(http://exceptions.core.gids.nl) namespace in which it is defined. In my test case, I
used the doctor to (runtime) patch the schema as follows:
> from suds.client import Clientfrom suds.client import Client
> from suds.xsd.doctor import ImportDoctor, Import
> url = 'https://webservices.gids2.nl/GidsV2Core/zoekservice?wsdl'
> imp = Import('http://exceptions.core.gids.nl')
> imp.filter.add('http://search.webservices.core.gids.nl/')
> d = ImportDoctor(imp)
> client = Client(url, doctor=d)
>
And the wsdl loaded properly.
Hope this helps,
Jeff
Rudi Alberda wrote:
> Hey guys
>
> I'm having a problem when upgrading to the 0.3.6 version of suds. I used
> 0.3.4 before and the issue didn't happen then. It seems to be a problem
> with parsing the WSDL, but as far as I can tell there is nothing wrong
> with it (I think it's generated by the apache CFX framework).
> Can anyone provide me with some insight into what's going wrong? I've
> tried using the schema doctor as mentioned in the Tips&Tricks section,
> but to no avail.
>
> Here's what happens:
>
> >>> from suds.client import Client
> >>> client =
> Client('https://webservices.gids2.nl/GidsV2Core/zoekservice?wsdl')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/client.py",
> line 106, in __init__
> self.wsdl = Definitions(url, options)
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
> line 191, in __init__
> self.open_imports()
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
> line 237, in open_imports
> imp.load(self)
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
> line 341, in load
> d = Definitions(url, definitions.options)
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
> line 194, in __init__
> self.set_wrapped()
> File "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/wsdl.py",
> line 303, in set_wrapped
> resolved = pt.resolve()
> File
> "/home/rual/workspace_drenthe/python-suds-0.3.6/suds/xsd/sxbasic.py",
> line 156, in resolve
> raise TypeNotFound(qref)
> suds.TypeNotFound: Type not found: '(GidsException,
> http://exceptions.core.gids.nl, )'
>
>
More information about the fedora-suds-list
mailing list