I'm trying to POST XML to my CherryPy server, but I'm getting the
following error:
File "C:\Python25\Lib\site-packages\cherrypy\_cprequest.py", line 617,
in respond
self.process_body()
File "C:\Python25\Lib\site-packages\cherrypy\_cprequest.py", line
739, in process_body
keep_blank_values=1)
File "C:\Python25\lib\site-packages\cherrypy\_cpcgifs.py", line 8,
in __init__
cgi.FieldStorage.__init__(self, *args, **kwds)
File "C:\Python25\lib\cgi.py", line 536, in __init__
self.read_single()
File "C:\Python25\lib\cgi.py", line 666, in read_single
self.read_binary()
File "C:\Python25\lib\cgi.py", line 680, in read_binary
data = self.fp.read(min(todo, self.bufsize))
File "C:\Python25\lib\site-packages\cherrypy\wsgiserver
\__init__.py", line 199, in read
data = self.rfile.read(size)
File "C:\Python25\lib\site-packages\cherrypy\wsgiserver
\__init__.py", line 809, in read
assert n <= left, "recv(%d) returned %d bytes" % (left, n)
AssertionError: recv(8192) returned 9655 bytes
9655 is the Content-Length of my message, the code that I'm using to
POST is:
headers = {'Content-type': 'text/xml',
'SOAPAction' : "",
"Content-Length" : len(xml)}
url = "
https://87.84.103.220:7443/soap/"
req = urllib2.Request(url, urllib.quote_plus(xml), headers)
response = urllib2.urlopen(req)
print response
print response.read()
With my CherryPy code as:
class Soap(object):
@cherrypy.expose()
def index(self):
try:
xmlBody = cherrypy.request.body.read()
..
Any ideas?