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:noName...
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"><so...
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:Sesame"><return
xsi:type="xsd:string"><?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>
</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