[Fedora-suds-list] Unmarshaller problem?!

Paulo Henrique Silva ph.silva at gmail.com
Thu May 15 06:51:55 UTC 2008


Hi guys,

I'm getting a strange bug using suds on this service
http://cdsws.u-strasbg.fr/axis/services/Sesame?wsdl.

My code is something like:

proxy = ServiceProxy(Simbad.WSDL)
print proxy.sesame ('M51', 'x')

and the result is something like:

<?xml version="1.0"encoding="UTF-8"?><Sesame
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="http://vizier.u-strasbg.fr/xml/sesame_2.xsd"><!--
Q28920 --><target>UFO</target><Resolver name="Simbad"><INFO>Zero (0)
answers</INFO><INFO>***  This identifier is not present in the
database: NAME UFO</INFO></Resolver><Resolver name="VizieR"><INFO>Zero
(0) answers</INFO><INFO>No table found for:
UFO</INFO></Resolver><Resolver name="Ned"><INFO>Zero (0)
answers</INFO><INFO>!***Connection to Ned
crashed</INFO></Resolver></Sesame>

Here is the problem: Note that there are no spaces between version and
encoding attributes on <?xml and later on Sesame namespace declaration
there are no spaces between two xsi declarations. This make this XML
not well formed and no parser accept to digest this.

When I turn debug on, I see this:

2008-05-15 03:38:16,747 {12055} (serviceproxy.py, 267) [DEBUG] http succeeded:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sesameResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:Sesame"><return xsi:type="xsd:string">&lt;?xml
version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;Sesame xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:noNamespaceSchemaLocation=&quot;http://vizier.u-strasbg.fr/xml/sesame_2.xsd&quot;&gt;
  &lt;!-- Q28920 --&gt;
  &lt;target&gt;UFO&lt;/target&gt;
  &lt;Resolver name=&quot;Simbad&quot;&gt;
    &lt;INFO&gt;Zero (0) answers&lt;/INFO&gt;
    &lt;INFO&gt;***  This identifier is not present in the database:
NAME UFO&lt;/INFO&gt;
  &lt;/Resolver&gt;
  &lt;Resolver name=&quot;VizieR&quot;&gt;
    &lt;INFO&gt;Zero (0) answers&lt;/INFO&gt;
    &lt;INFO&gt;No table found for: UFO&lt;/INFO&gt;
  &lt;/Resolver&gt;
  &lt;Resolver name=&quot;Ned&quot;&gt;
    &lt;INFO&gt;Zero (0) answers&lt;/INFO&gt;
    &lt;INFO&gt;!***Connection to Ned crashed &lt;/INFO&gt;
  &lt;/Resolver&gt;
&lt;/Sesame&gt;
</return></ns1:sesameResponse></soapenv:Body></soapenv:Envelope>

>From this, seems that somewhere in the unmarshaller, the \n are
replaced and all the lines are stripped, making the errors cited
above.

While I was writing this I found that on sax.py:Handler.characters
there is a strip call! If I remove that strip, everything goes well!
Is that strip really necessary or is this a bug?

Thanks a lot,

-- Paulo Henrique




More information about the suds mailing list