cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: SOAP Payload size in a request
Date Fri, 06 Mar 2009 02:10:31 GMT

With chunking mode, there isn't a way to determine the length without reading 
the entire message, which would break streaming and affect performance. 

The BEST way to deal with this would be to write an interceptor that lives 
VERY early in the chain, takes the InputStream and wrappers it with an input 
stream that records the number of bytes read.   Once a threashold is hit, 
throw an exception or similar.


On Thu March 5 2009 6:18:43 pm Mahesh Seshan wrote:
> Hello,
> We use Apache CXF 2.1.3 as our SOAP engine and Apache Tomcat 6 to handle
> When a SOAP requests is received by the system (via HTTP binding), how
> do I get the size of the payload so we can make security decision to
> process the request or not (because it may cause resource constraint)
> ? Specifically, when HTTP Transfer-encoding is chunked, there is no
> Content-Length field in the HTTP Servlet Request. In that case how do
> I get the size of the SOAP payload ?
> Or, better yet, is there a way to configure CXF to refuse request that
> is greater than certain size ?
> Any help or pointers appreciated.
> Thank you,
> -mahesh

Daniel Kulp

View raw message