I am testing the latest release of CXF 2.0.4 and I got some unexpected
results. On the client side, I got the following from the server side
response and I have received the “JSESSIONID” in the cookie “Set-Cookie”.

Headers: {Content-Length=[329], X-Powered-By=[Servlet 2.4; JBoss-4.0.5.GA
(build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5],
Set-Cookie=[LSCookie=AA38FF4D7AD8E693942E95BB1AFAD5D8$$$,
JSESSIONID=AA38FF4D7AD8E693942E95BB1AFAD5D8; Path=/], Date=[Fri, 15 Feb 2008
00:22:18 GMT], SOAPAction=["urn:RetrieveContact"],
Server=[Apache-Coyote/1.1], content-type=[text/xml;charset=UTF-8]}

I call the following on the client side to pass the header info back to the
server side for all subsequent requests:
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

On the server side, I could not see the “JSESSIONID” in the cookie when I
use an interceptor of “Phase.PRE_PROTOCOL” or “Phase.READ”.

19:22:19,140 INFO  [STDOUT] Headers: {connection=[keep-alive],
cache-control=[no-cache], host=[localhost:8888], user-agent=[Java/1.5.0_12],
transfer-encoding=[chunked], pragma=[no-cache], content-type=[text/xml;
charset=UTF-8], cookie=[$Version="1";
LSCookie=AA38FF4D7AD8E693942E95BB1AFAD5D8$$$], accept=[*],
soapaction=["urn:RetrieveContact"]}

Please help me to understand how to retrieve the values of all cookies in an
interceptor on the server side? Why would I get a null value of
“httpSession” in my interceptor of “Phase.PRE_PROTOCOL” or “Phase.READ”
which extends AbstractPhaseInterceptor<Message> for all subsequent requests?
                            HttpServletRequest request =
(HttpServletRequest)message.getContextualProperty(HTTP_REQUEST);
                            HttpSession httpSession =
request.getSession(false);

I would just like to add one more piece of info for this thread. When I
switch to Axis2 on my SOAP client by calling:
Options options = new Options();
options.setManageSession(true);
client.setOptions(options);

I got the following header info on the server side using the same CXF
implementation:
07:33:10,078 INFO  [STDOUT] Headers: {host=[localhost:8888],
user-agent=[Axis2], transfer-encoding=[chunked],
cookie=[JSESSIONID=D4485D75748F657BA06C7A2E67F5323F; Path=/],
content-type=[text/xml; charset=UTF-8], soapaction=["urn:anonOutInOp"]}

I got the value of “JSESSIONID” cookie on the server side, but
unfortunately, also lost the value of the other cookie “LSCookie”, a similar
bug of CXF which has been fixed. The real world is never perfect ………………..

-- 
View this message in context: 
http://www.nabble.com/JSESSIONID-cookie-not-sent-back-to-server-tp15514055p15514055.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to