Hi Gabo
If you implement a CXF JAXRS RequestFilter then input message is available as
an input parameter.
If you implement a CXF JAXRS ResponseFilter then output message is available as
an output parameter.
If you do both JAXRS and JAXWS then you might want to consider using CXF in/out interceptors, those which have
handleMessage(Message) method.
It's not possible an internal CXF Exchange be injected as part of JAXRS invocation - you might be able to get to it from a JAXWS
WebServiceContext somehow but not from JAXRS.
Additionally, if you'd like to modify an output message only you might want to consider doing it indirectly, using JAXRS Response
class....
Cheers, Sergey
Hi All,
I was hoping to have some things set in the handlers, e.g. username passed in the Authorization token; and have that username (or
a java bean) available when the method is finally invoked.
I've read somewhere that the class org.apache.cxf.message.Exchange would have the in and out Message available for JAX-RS
services, however, I am not sure how to get the said object. I have tried having the following as method parameter or as class
variable to no avail:
@Context
Exchange ex
As a parameter, the handlers are able to finish, but when it comes to invocation of the actual method/endpoint I get this
exception:
<ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">java.lang.IllegalArgumentException: wrong number of
arguments</ns1:faultstring>
As a class variable, the said object is always null.
Again, my thanks.
Gabo