0

I have soap webservice built with soaplib, but if client sent chunked request it fails on

length = req_env.get("CONTENT_LENGTH")
body = input.read(int(length))
because length is '' (empty string), any ideas how to fix soaplib?

Kevin P.
  • 1,414
  • 1
  • 18
  • 24
Andrey Koltsov
  • 1,956
  • 6
  • 24
  • 43
  • What exactly are you seeing? And, if you think this is a legitimate bug, submit it to http://bugs.python.org. StackOverflow is not a bug tracker. – Santa Mar 18 '11 at 16:34

1 Answers1

0

a bit ugly, but looks like it works:

            if '' != length:
                body = input.read(int(length))
            elif req_env.get("HTTP_TRANSFER_ENCODING").lower() == 'chunked':

                chunk_size = int(input.readline(), 16)
                while chunk_size > 0:
                    chunk_read_size = 0
                    tmp  = input.read(chunk_size)
                    chunk_read_size += len(tmp)
                    body += tmp
                    while chunk_read_size 
Andrey Koltsov
  • 1,956
  • 6
  • 24
  • 43