Hi,

As you wanna read Content-Lenght, I assume you wanna determine the message size 
on receiver side, and the code I showed you works on receiver side.
If you need know the message size on sender side, take a look at Dan's 
suggestion.

Freeman
-------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-9-12, at 下午9:21, shadowlaw wrote:

> thank you for the reply, the you listed code isn't for a client side?
> I'm trying something like this
> 
> OutputStream os = message.getContent(OutputStream.class);
> //        CacheAndWriteOutputStream cwos = new
> CacheAndWriteOutputStream(os);
>        CachedOutputStream cachedOutputStream = new CachedOutputStream();
>        cachedOutputStream.setMaxSize(300L);
>        try {
>            cachedOutputStream.writeCacheTo(os);
>        } catch (IOException e) {
>            e.printStackTrace();
>        }
>        message.setContent(OutputStream.class, cachedOutputStream);
> 
> writeCacheTo will throw an CacheExceededException if the size exceed what's
> configured, what's the best solution?
> 
> 
> 
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/extract-Http-Headers-tp5713851p5713855.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to