Question

J'ai construit avec du savon webservice soaplib, mais si le client demande envoyée Chunked il échoue sur

length = req_env.get("CONTENT_LENGTH")
body = input.read(int(length))
parce que la longueur est '' (chaîne vide), des idées comment fixer soaplib?

Était-ce utile?

La solution

un peu laid, mais ressemble à cela fonctionne:

            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 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top