Thank you very much for your answer.
Only now I tried to use your suggestion, because I was fixing
other problems with my application.
Could you kindly help me once again, please?
Here I remind my problem:
I'm using cxf 2.1.3, with servicemix 3.2.3
and I'd like to mantain a conversational state
between a client and a web service setting to maintain a session.
I have published a cxf-se and cxf-bc for a service,
and there is an external client invoking method on the service.
I tried this:
(CLIENT SIDE)
TargetWSImplService ss = new TargetWSImplService(wsdlURL, SERVICE_NAME);
TargetWSImpl port = ss.getTargetWSImplPort();
((BindingProvider)port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
(SERVER SIDE)
MessageContext mc = context.getMessageContext();
HttpSession session =
((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
if (session == null) {
logger.info("Starting the Session");
}
but when a try:
11-gen-2009 2.45.06 org.apache.cxf.transport.jbi.JBITransportFactory
setDeliveryChannel
INFO: configuring DeliveryChannel:
org.apache.servicemix.common.endpointdeliverychan...@15abfe1
11-gen-2009 2.45.07 org.apache.cxf.transport.jbi.JBITransportFactory
setDeliveryChannel
INFO: configuring DeliveryChannel:
org.apache.servicemix.common.endpointdeliverychan...@15abfe1
java.lang.NullPointerException
at songND.tws.TargetWSImpl.doLogin(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:136)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:110)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
at
org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
at org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:284)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
11-gen-2009 2.45.07 org.apache.cxf.transport.jbi.JBITransportFactory
setDeliveryChannel
I suppose that the example I found isn't fit for servicemix..
would you give me any suggestion, please?
Should I have to configure something in spring for the cxf-se
or cxf-bc?
Thank you in advance.
Best Regards,
silvia
---------- Initial Header -----------
>From : "Ian Roberts" [email protected]
To : [email protected]
Cc :
Date : Sun, 04 Jan 2009 18:34:14 +0000
Subject : Re: session between a ws service and a client in cxf
> Julio Oliveira wrote:
> > There are some for JAX-RS ?
>
> As far as I know, CXF doesn't provide anything for the *client* side of
> RESTful services.
>
> For server-side session support you should just be able to make your
> service beans session-scoped (with <aop:scoped-proxy/>). See the notes
> at the bottom of http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
> about Spring AOP for details of the potential pitfalls. Alternatively
> you could use the HttpSession directly by injecting a MessageContext
> into a singleton service bean and accessing the HttpServletRequest
> through that.
>
> Ian
>
> --
> Ian Roberts | Department of Computer Science
> [email protected] | University of Sheffield, UK
>