[Soap-Python] rpclib and Content-Length header?

burak.arslan at arskom.com.tr burak.arslan at arskom.com.tr
Fri Mar 9 05:27:08 CET 2012


On 08.03.2012 17:19, Kevin Murphy wrote:
> Hello,
>
> I've written a SOAP service using rpclib 2.6.1-beta1 (originally with
> 2.5.2, same issue) and I'm noticing that the Content-Length header is
> never being set on the response from the application.
>
> This is causing undesirable behavior when the application is mounted
> with uWSGI in Apache (sometimes Apache is adding the
> Transfer-Encoding: chunked header), so I'm attempting to figure out
> how I can correct this so that the Content-Length is always being 
> set.

Hi Kevin,

To set the Content-Length header, you have to have the whole response 
in memory. And since the beginning my aim has been to have rpclib work 
without having the whole message in memory in order to have the ability 
to return HUGE responses. (see the roadmap document) So I've 
intentionally suppressed the Content-Length header from responses. But I 
never thought this would have side effects. So here's a quick patch for 
that: 
https://github.com/plq/rpclib/commit/7092617b74bd6b3a2d57fd9833336b851208a672

Does it work for you?

> I noticed that protocol/soap/mime.py has code to deal with
> Content-Length, so to activate this I tried setting _mtom=True in my
> method decorator,

<snip>

> So… basically I'm guessing that I'm in uncharted territory here and
> this code must not get used often.

You're right, There's been a long time since I touched the mtom code. I 
doubt it works at all.

Best,
Burak


More information about the Soap mailing list