[Soap-Python] lxml validation is too restrictive

azurIt azurit at pobox.sk
Tue Sep 27 22:44:02 CEST 2011


Hi,

lxml is, unfortunately, too restrictive in XML validating :( For example, PHP soap client stopped working at all, lxml is not accepting it's element names:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="testt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:testf>
<first xsi:type="xsd:string">aaa</first>
<second xsi:type="xsd:string">bbb</second>
</ns1:testf>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

rpclib error:
<string>:2:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element 'first': This element is not expected. Expected is ( {testt}first ).


This is XML generated by SUDS (and accepted by rpclib):
<SOAP-ENV:Envelope xmlns:ns0="testt" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <ns1:Body>
      <ns0:testf>
         <ns0:first>aaa</ns0:first>
         <ns0:second>bbb</ns0:second>
      </ns0:testf>
   </ns1:Body>
</SOAP-ENV:Envelope>

Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ?


More information about the Soap mailing list