[Soap-Python] Contect-Type encoding

Burak Arslan burak.arslan at arskom.com.tr
Wed Jul 28 18:11:53 CEST 2010


On 07/28/10 18:41, Luca Dariz wrote:
> Hello,
>
> i have this exception raised using soaplib 0.9.0-alpha3 with python
> 2.5.2, installed from pypi:
>
>   File
> "/home/voip/luca/python-virtualenv-soaplib0.9/lib/python2.5/site-packages/soaplib-0.9.0_alpha3-py2.5.egg/soaplib/wsgi.py",
> line 162, in __call__
>     soap_req_payload, soap_req_header = from_soap(body)
>   File
> "/home/voip/luca/python-virtualenv-soaplib0.9/lib/python2.5/site-packages/soaplib-0.9.0_alpha3-py2.5.egg/soaplib/soap.py",
> line 70, in from_soap
>     root, xmlids = etree.XMLID(xml_string)
>   File "xmlid.pxi", line 18, in lxml.etree.XMLID
> (src/lxml/lxml.etree.c:88472)
>   File "lxml.etree.pyx", line 2512, in lxml.etree.XML
> (src/lxml/lxml.etree.c:48408)
>   File "parser.pxi", line 1536, in lxml.etree._parseMemoryDocument
> (src/lxml/lxml.etree.c:72143)
> ValueError: Unicode strings with encoding declaration are not supported.
>
> I am using ruby's rpc driver for the client, but with suds everything
> works fine.
>
> With soaplib 0.8.2-alpha2 everything works with both clients too.
>
> I think the decoding of the http payload isn't handled correctly, or
> am i wrong?
>

can you share the xml that is produced by the ruby client?

i'm guessing that ruby produces a document with xml declaration, and
suds omits the xml declaration. so lxml tries to apply the encoding in
the xml declaration, but refuses to re-decode an already-decoded xml string.

if that's the case, it's a bug.

best,
burak






More information about the Soap mailing list