On Sep 26, 2014, at 1:00 PM, Roberto Polli <[email protected]> wrote:

> Hi@all,
> 
> I'm writing a webservice and I wasn't able to find a jax-ws standard
> way to compute the message size, unless I re-serialize it.
> 
> I thought that the interceptor which manages the (un)marshalling
> should know in some way the request/response size - at least on HTTP:
>  - does that interceptor(s) store the request/response size somewhere?

It doesn't.  If the message is coming in “chunked” then we have no idea how 
large the request is.  

>  - are there any drawbacks in exporting that information in the
> jax-ws messageContext?

The only real way for you do do this is grab the InputStream very early in the 
interceptor chain and wrapper it with an InputStream that would record the 
number of bytes read.   Sometime before the invoke, grab that number from that 
stream in another interceptor.

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to