<br><div class="gmail_quote">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).<br><br><span style="font-family: courier new,monospace;">from suds.client import Client</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">wsdl = '<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">client = Client(wsdl, cache=None)</span><br><br>Debug trace returns :<br><br><span style="font-family: courier new,monospace;">.DEBUG:suds.wsdl:reading wsdl at: <a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a> ...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.transport.http:opening (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.metrics:sax (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>) duration: 406 (ms)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.sxbasic:Import:0x7f90196fd5f0, importing ns="<a href="http://webservices.sabre.com/sabreXML/2003/07" target="_blank">http://webservices.sabre.com/sabreXML/2003/07</a>", location="OTA_AirPriceLLSRQRS.xsd"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.transport.http:opening (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd</a>)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.metrics:sax (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQRS.xsd</a>) duration: 504 (ms)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.sxbasic:Include:0x7f90196fdf80, importing ns="None", location="OTA_AirPriceLLSRQ.xsd"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.transport.http:opening (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.metrics:sax (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>) duration: 1.363 (seconds)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.schema:built:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Schema:0x7f9019708e60</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">(...)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">DEBUG:suds.xsd.query:(u'MessageHeader', <a href="http://www.ebxml.org/namespaces/messageHeader" target="_blank">http://www.ebxml.org/namespaces/messageHeader</a>), found as: <Element:0x1f68dd0 name="MessageHeader" /></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.query:(u'Security', <a href="http://schemas.xmlsoap.org/ws/2002/12/secext" target="_blank">http://schemas.xmlsoap.org/ws/2002/12/secext</a>), found as: <Element:0x21a3a28 name="Security" /></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.query:(u'OTA_AirPriceRQ', <a href="http://webservices.sabre.com/sabreXML/2003/07" target="_blank">http://webservices.sabre.com/sabreXML/2003/07</a>), not-found</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Ran 2 tests in 11.669s</span><br><br>Type not found: '(OTA_AirPriceRQ, <a href="http://webservices.sabre.com/sabreXML/2003/07" target="_blank">http://webservices.sabre.com/sabreXML/2003/07</a>, )'<br>
<br>It's logic : Python Suds loads OTA_AirPriceRQ in a "None" namespace.<br>I read "fix broken schema" Python Suds documentation (<a href="https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs" target="_blank">https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs</a>):<br>
<br><span style="font-family: courier new,monospace;">from suds.client import Client</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">from suds.xsd.doctor import ImportDoctor, Import</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">wsdl = '<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">imp = Import('<a href="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ" target="_blank">http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ</a>', '<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>')</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">d = ImportDoctor(imp)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">client = Client(wsdl, cache=None, doctor=d)</span><br>
<br>But script return another exception :<br><span style="font-family: courier new,monospace;">.DEBUG:suds.wsdl:reading wsdl at: <a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a> ...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.transport.http:opening (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.metrics:sax (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.wsdl</a>) duration: 617 (ms)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.doctor:inserting: <xs:import xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>" namespace="<a href="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ" target="_blank">http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ</a>" schemaLocation="<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>"/></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.sxbasic:Import:0xe6cf80, importing ns="<a href="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ" target="_blank">http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ</a>", location="<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.transport.http:opening (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.metrics:sax (<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>) duration: 1.375 (seconds)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DEBUG:suds.xsd.doctor:inserting: <xs:import xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>" namespace="<a href="http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ" target="_blank">http://webservices.sabre.com/sabreXML/2003/07/OTA_AirPriceLLSRQ</a>" schemaLocation="<a href="http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd" target="_blank">http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/OTA_AirPriceLLSRQ.xsd</a>"/></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">(...)</span><br>Error maximum recursion depth exceeded while calling a Python object<br><br><br>I don't understand how to use "doctor" functions. Somebody can help me, please ?<br>
Thank you.<br><br><br>
</div><br>