mettienne / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

problem with non-ascii charts in SOAP call #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I wonder if somebody could help me.

What steps will reproduce the problem?
1. try something like: 
res=client.RegisterShipment(request={u'ShipmentId':u'kettő'})

What is the expected output? What do you see instead?

    res=client.RegisterShipment(request={u'ShipmentId':u'kettő'})
  File "/home/szimszon/fejlesztes/sajat/web2py/gluon/contrib/pysimplesoap/client.py", line 147, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr,*args,**kwargs)
  File "/home/szimszon/fejlesztes/sajat/web2py/gluon/contrib/pysimplesoap/client.py", line 326, in wsdl_call
    response = self.call(method, *params)
  File "/home/szimszon/fejlesztes/sajat/web2py/gluon/contrib/pysimplesoap/client.py", line 211, in call
    self.xml_response = self.send(method, self.xml_request)
  File "/home/szimszon/fejlesztes/sajat/web2py/gluon/contrib/pysimplesoap/client.py", line 245, in send
    location, "POST", body=xml, headers=headers)
  File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1444, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1196, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1133, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 958, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 812, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 348: 
ordinal not in range(128)

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by szims...@gmail.com on 1 Nov 2012 at 7:10

GoogleCodeExporter commented 9 years ago
With pycurl I think it's working...

Original comment by szims...@gmail.com on 1 Nov 2012 at 9:20

GoogleCodeExporter commented 9 years ago
could you attach a minimal but complete example to reproduce this bug?

Original comment by reingart@gmail.com on 2 Nov 2012 at 6:22

GoogleCodeExporter commented 9 years ago
Here is an example...

If I set in transport.py set_http_wrapper('pycurl') than it's ok. But not with 
the others...

Original comment by szims...@gmail.com on 2 Nov 2012 at 6:59

Attachments:

GoogleCodeExporter commented 9 years ago
And I use now pysimplesoap-1.05a.zip ...

Original comment by szims...@gmail.com on 2 Nov 2012 at 7:00

GoogleCodeExporter commented 9 years ago
Oh, I see web2py's pysimplesoap is newer... I re-upgraded but the result is the 
same. :( Pycurl transport works.

Original comment by szims...@gmail.com on 2 Nov 2012 at 7:14