I have an "in" CXF Interceptor, I want to access the the Servlet Session in its handleMessage()
method. My Interceptor extends AbstractPhaseInterceptor
.
I want to access the session to store some info about the user as my web service client maintains sessions.
I can already access the session in my web services.
Interceptors are the fundamental processing unit inside CXF. When a service is invoked, an InterceptorChain is created and invoked. Each interceptor gets a chance to do what they want with the message. This can include reading it, transforming it, processing headers, validating the message, etc.
Apache CXF™ is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.
Class JaxWsProxyFactoryBeanFactory for creating JAX-WS proxies, This class provides access to the internal properties used to set-up proxies. Using it provides more control than the standard JAX-WS APIs.
You should be able to do
HttpServletRequest req = (HttpServletRequest)message.get("HTTP.REQUEST");
to get the HttpServletReqest where you can then grab the session from it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With