Python SUDS issue

Dieter Maurer dieter at handshake.de
Thu Mar 7 07:55:43 CET 2013


VGNU Linux wrote at 2013-3-7 10:07 +0530:
>Not aware what "import" here is and what it will do.

XML-schema has an "import" facility to modularize schema descriptions.
It is very similar to the "import" facilities you know from Python
(and a lot of other languages) -- and has very similar purpose.

> ...
>Here is what i changed.
>from suds.client import Client
>from suds.xsd.doctor import Import, ImportDoctor
>from suds.sax.element import Element
>
>wsdlurl = 'https://46.51.221.138/PBExternalServices/v1/soap?wsdl'
>schemaurl = 'http://www.payback.net/lmsglobal/xsd/v1/types'
>schemaimport = Import(schemaurl)
>schemadoctor = ImportDoctor(schemaimport)
>client = Client(url=wsdlurl,doctor=schemadoctor)
>print client
>
>Printing client now lists all the methods and types associated with the
>service.
>But again stuck as on executing a method
>response = client.service.GetAccountBalance(authtype)
>replies with the error.
>ValueError: unknown url type: {endpoint address}
>
>Totally confused as what is wrong going on here.

Again, this looks like a bug in the WSDL description of the
web service.

To understand the problem better, you should look at the
corresponding traceback (as always). It will tell you
where the "ValueError" comes from. At the corresponding
code location, you should learn whether "{endpoint address}"
is the literal value of the bad url or an indication given
by "suds" where it has found the bad url.

In the first case, search the WSDL for "endpoint address" -
and then get it fixed.
In the second case, the bad value likely comes from
the "location" attribute of a "soap:address" element below
"wsdl:service" (again in your WSDL). Again, get it fixed, then.



--
Dieter



More information about the Python-list mailing list