Hi
You can use JAX-RS 2.0 ContainerResponseFilter with 2.0 ResourceInfo [1]
context injected into it. Or access Response annotations (method
annotations by default) directly from ContainerResponseFilter response
context.
In a pure CXF out interceptor you can get it from the exchange:
OperationResourceInfo ori = exchange.get(OperationResourceInfo.class);
ori.getMethodToInvoke();
HTH, Sergey
[1]
https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/container/ResourceInfo.html
On 31/07/14 17:24, New Groovy wrote:
Thanks, Dan!
One more question, how do I retrieve the method called (I need to retrieve
the annotations from it) if it's a JAX-RS method?
I have used this for in interceptors, but doesn't seem to be working for
out interceptor:
private Method getTargetMethod(Message m) {
BindingOperationInfo bop =
m.getExchange().get(BindingOperationInfo.class);
if (bop != null) {
MethodDispatcher md = (MethodDispatcher)
m.getExchange().get(Service.class).get(MethodDispatcher.class.getName());
return md.getMethod(bop);
}
return (Method)m.get("org.apache.cxf.resource.method");
}
On Mon, Jul 28, 2014 at 10:06 AM, Daniel Kulp <[email protected]> wrote:
Move your interceptor up into the PRE_LOGICAL with a
addBefore(WrapperClassOutInterceptor.class.getName()). The list should
then just have the return value (and any holders for other outs). The
WrapperClassOutInterceptor combines those into the asm generate object.
Dan
On Jul 27, 2014, at 10:47 PM, New Groovy <[email protected]> wrote:
Hi,
I want to filter some return values in an out interceptor, but am
struggling to figure out how to retrieve it.
I have tried this:
MessageContentsList outObjects =
MessageContentsList.getContentsList(message);
Exchange exchange = message.getExchange();
OperationInfo op = exchange.getBindingOperationInfo() == null
? null
: exchange.getBindingOperationInfo().getOperationInfo();
and see a lot of info...but can't figure out how to retrieve the _return
value I see in the xxx.jaxws_asm
Any pointers?
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com