You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mahesh Seshan <ma...@gmail.com> on 2009/03/06 00:18:43 UTC

SOAP Payload size in a request

Hello,

We use Apache CXF 2.1.3 as our SOAP engine and Apache Tomcat 6 to handle HTTP.

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

Re: SOAP Payload size in a request

Posted by Mahesh Seshan <ma...@gmail.com>.
Glenn,

Thank you for the prompt response.

Unfortunately, cannot turn off chunking...because via SOAP, we could
get huge request and we want to benefit from chunking.

Regards,

-mahesh

On Thu, Mar 5, 2009 at 6:21 PM, Glen Mazza <gl...@gmail.com> wrote:
>
> Chunking can be turned off (search the CXF user's guide for that) always
> giving you a Content-Length field as a result--is that an option for you?
>
> Glen
>
>
> Mahesh Seshan wrote:
>>
>> Hello,
>>
>> We use Apache CXF 2.1.3 as our SOAP engine and Apache Tomcat 6 to handle
>> HTTP.
>>
>> 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
>>
>>
>
> --
> View this message in context: http://www.nabble.com/SOAP-Payload-size-in-a-request-tp22363005p22363039.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: SOAP Payload size in a request

Posted by Glen Mazza <gl...@gmail.com>.
Chunking can be turned off (search the CXF user's guide for that) always
giving you a Content-Length field as a result--is that an option for you?

Glen


Mahesh Seshan wrote:
> 
> Hello,
> 
> We use Apache CXF 2.1.3 as our SOAP engine and Apache Tomcat 6 to handle
> HTTP.
> 
> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/SOAP-Payload-size-in-a-request-tp22363005p22363039.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SOAP Payload size in a request

Posted by Daniel Kulp <dk...@apache.org>.
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.

Dan


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
> HTTP.
>
> 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
dkulp@apache.org
http://www.dankulp.com/blog