[Fedora-suds-list] TypeNotFound exception : how to import XSD schema with Python Suds (version 0.3.6) SOAP library ?

Jeff Ortel jortel at redhat.com
Mon Aug 31 16:20:07 UTC 2009


Paul,

Yup, the <xs:include/> was broken.  Fixed in r558 and will be released in 0.3.7.  I tried 
with your wsdl and loads fine.

Thanks for bringing this to our attention.

Regards,

Jeff

On 08/31/2009 05:42 AM, Paul Poulet wrote:
>
> I'm trying to use SABRE travel web services with Python Suds 0.3.6, but
> one XSD seems not well-formed (maybe namespace is missing in this schema).
>
> from suds.client import Client
> wsdl =
> 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl'
> client = Client(wsdl, cache=None)
>
> Debug trace returns :
>
> .DEBUG:suds.wsdl:reading wsdl at:
> http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl
> ...
> DEBUG:suds.transport.http:opening
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl)
> DEBUG:suds.metrics:sax
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl)
> duration: 406 (ms)
> DEBUG:suds.xsd.sxbasic:Import:0x7f90196fd5f0, importing
> ns="http://webservices.sabre.com/sabreXML/2003/07",
> location="OTA_AirPriceLLSRQRS.xsd"
> DEBUG:suds.transport.http:opening
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd)
> DEBUG:suds.metrics:sax
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd)
> duration: 504 (ms)
> DEBUG:suds.xsd.sxbasic:Include:0x7f90196fdf80, importing ns="None",
> location="OTA_AirPriceLLSRQ.xsd"
> DEBUG:suds.transport.http:opening
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd)
> DEBUG:suds.metrics:sax
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd)
> duration: 1.363 (seconds)
> DEBUG:suds.xsd.schema:built:
> Schema:0x7f9019708e60
> (...)
> DEBUG:suds.xsd.query:(u'MessageHeader',
> http://www.ebxml.org/namespaces/messageHeader), found as:
> <Element:0x1f68dd0 name="MessageHeader" />
> DEBUG:suds.xsd.query:(u'Security',
> http://schemas.xmlsoap.org/ws/2002/12/secext), found as:
> <Element:0x21a3a28 name="Security" />
> DEBUG:suds.xsd.query:(u'OTA_AirPriceRQ',
> http://webservices.sabre.com/sabreXML/2003/07), not-found
> .
> ----------------------------------------------------------------------
> Ran 2 tests in 11.669s
>
> Type not found: '(OTA_AirPriceRQ,
> http://webservices.sabre.com/sabreXML/2003/07, )'
>
> It's logic : Python Suds loads OTA_AirPriceRQ in a "None" namespace.
> I read "fix broken schema" Python Suds documentation
> (https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs):
>
> from suds.client import Client
> from suds.xsd.doctor import ImportDoctor, Import
> wsdl =
> 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl'
> imp =
> Import('http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ', 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd')
> d = ImportDoctor(imp)
> client = Client(wsdl, cache=None, doctor=d)
>
> But script return another exception :
> .DEBUG:suds.wsdl:reading wsdl at:
> http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl
> ...
> DEBUG:suds.transport.http:opening
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl)
> DEBUG:suds.metrics:sax
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl)
> duration: 617 (ms)
> DEBUG:suds.xsd.doctor:inserting: <xs:import
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> namespace="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ"
> schemaLocation="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd"/>
> DEBUG:suds.xsd.sxbasic:Import:0xe6cf80, importing
> ns="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ",
> location="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd"
> DEBUG:suds.transport.http:opening
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd)
> DEBUG:suds.metrics:sax
> (http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd)
> duration: 1.375 (seconds)
> DEBUG:suds.xsd.doctor:inserting: <xs:import
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> namespace="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ"
> schemaLocation="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd"/>
> (...)
> Error maximum recursion depth exceeded while calling a Python object
>
>
> I don't understand how to use "doctor" functions. Somebody can help me,
> please ?
> Thank you.
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3360 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20090831/70c53492/attachment.bin 


More information about the suds mailing list