Hi,
Normally you can get http headers through code like
Map<String, List<String>> headers
= CastUtils.cast((Map<?,
?>)message.get(Message.PROTOCOL_HEADERS));
then you can get any http headers from this map.
You can get current message anywhere, even in your impl class, like using a
static method
PhaseInterceptorChain.getCurrentMessage()
However by default CXF enable chunk[1] so you may not get a meaningful
content-length if the message is big.
[1]http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-ANoteAboutChunking
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 下午4:44, shadowlaw wrote:
> Hi,
>
> I want to extract the HTTP Headers from a response, more exactly the
> content-length of the response in order to raise an exception if it exceeds
> a certain size. I've been trying to do this for two days now without any
> success. How can i do this and is it more clean to use an interceptor or a
> handler for this.
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/extract-Http-Headers-tp5713851.html
> Sent from the cxf-user mailing list archive at Nabble.com.