[jboss-user] [JBossWS] - Re: JBOSS-WS Client not sending COOKIE after 2 calls

lowecg2004 do-not-reply at jboss.com
Sun Jul 29 20:56:22 EDT 2007


I'm using 2.0.0 web services in a similar way to the author but I'm getting some slightly different problems with sessions.

I call a web service method that creates a HttpSession and saves some state to that session using httpSession.setAttribute("userId", userId).  At the client, I get JSESSIONID back from a HTTP cookie which I pass on to a subsequent call to a servlet that is part of the same JEE context.  In the servlet I verify that httpSession.getId() matches the session ID created in the web service, however a call to httpSession.getAttribute("userId") is null.

Could this be part of the same problem? The web service is declared under Seam 2.0.0b1, so is it possible that this could also be part of the problem?

To try and see if I could work around the issue, I thought I would experiment and create a jsession in a separate servlet call and then make the web service call participate in the existing session (rather than rely on the web service creating the session).  Now I cannot even get a cookie (or any other HTTP header value for that matter) to pass to the server.  

After reading the following:


I thought that this code would work:
final DevelopmentService_Service service = new DevelopmentService_Service();
  | final DevelopmentService proxy = service.getDevelopmentServicePort();
  | ((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
  | final HttpCookie jSessionId = getJSessionId();
  |                  ((BindingProvider)proxy).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS,
  |             Collections.singletonMap("Cookie",Collections.singletonList(jSessionId.toString())));
But no joy.  Incidentally, the HTTP compression example given at the URL above doesn't work either.

Should I be able to pass HTTP parameters from the client to the server in this way?



Clients were generated using wsconsume
JBossWS 2.0.0.GA
JBossAS 4.2.0.GA
JBoss Seam 2.0.0.b1
Java 1.6.0_02 client and server

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068575#4068575

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068575

More information about the jboss-user mailing list