Cp1251-symbols in SOAP request

Pelmen pelmenmail at mail.ru
Sat Dec 17 20:59:21 CET 2005


in short
>>> doc = SOAPpy.SOAPProxy('localhost:8000', 'urn:Server', encoding='cp1251')
>>> doc.invoke('НомерДок'.decode('cp1251'), ())
*** Outgoing SOAP
******************************************************
<?xml version="1.0" encoding="cp1251"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>
<SOAP-ENV:Body>
<ns1:НомерДок xmlns:ns1="urn:Server" SOAP-ENC:root="1">
</ns1:НомерДок>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
Traceback (most recent call last):
  File "<pyshell#62>", line 1, in -toplevel-
    doc.invoke('НомерДок'.decode('cp1251'), ())
  File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 322, in
invoke
    return self.__call(method, args, {})
  File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 364, in
__call
    config = self.config)
  File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 196, in
call
    r.endheaders()
  File "C:\Python24\lib\httplib.py", line 795, in endheaders
    self._send_output()
  File "C:\Python24\lib\httplib.py", line 676, in _send_output
    self.send(msg)
  File "C:\Python24\lib\httplib.py", line 655, in send
    self.sock.sendall(str)
  File "<string>", line 1, in sendall
UnicodeEncodeError: 'ascii' codec can't encode characters in position
161-168: ordinal not in range(128)

How can i force this problem.
Thanks.




More information about the Python-list mailing list