You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Penmatsa, Vinay" <vi...@sap.com> on 2014/01/02 16:55:34 UTC
Limit payload by size
Hi,
I want to limit the xml payload size received by REST service (dispatcher based). In the CXF documentation, I see that there's a DepthRestrictingStreamInterceptor that works on element counts, but is there something built-in that looks at size of payload?
Or do I have to implement it as suggested in http://cxf.547215.n5.nabble.com/SOAP-Payload-size-in-a-request-td562620.html
Thanks,
Vinay
Re: Limit payload by size
Posted by Daniel Kulp <dk...@apache.org>.
If using XML that would go through the StaxInInterceptor for parsing, there are other settings that can limit the size. See:
http://cxf.apache.org/docs/security.html#Security-ControllingLargeRequestPayloads
For other cases, you would need to write a simple InputStreamFilter.
Dan
On Jan 2, 2014, at 10:55 AM, Penmatsa, Vinay <vi...@sap.com> wrote:
> Hi,
> I want to limit the xml payload size received by REST service (dispatcher based). In the CXF documentation, I see that there's a DepthRestrictingStreamInterceptor that works on element counts, but is there something built-in that looks at size of payload?
> Or do I have to implement it as suggested in http://cxf.547215.n5.nabble.com/SOAP-Payload-size-in-a-request-td562620.html
>
> Thanks,
> Vinay
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Limit payload by size
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
Yes, the size of the payload will need to be checked manually. I guess
you can replace an InputStream with the filter stream which will check a
number of bytes read
Cheers, Sergey
On 02/01/14 15:55, Penmatsa, Vinay wrote:
> Hi,
> I want to limit the xml payload size received by REST service (dispatcher based). In the CXF documentation, I see that there's a DepthRestrictingStreamInterceptor that works on element counts, but is there something built-in that looks at size of payload?
> Or do I have to implement it as suggested in http://cxf.547215.n5.nabble.com/SOAP-Payload-size-in-a-request-td562620.html
>
> Thanks,
> Vinay
>