If what you're looking for is the AXIS session, then once you have the
MessageContext, it has a method conveniently called getSession();

If instead you really are looking for the HttpServletRequest (and/or
response object) to help you debug why it's not maintaining state, take a
look at how AxisServlet sets up the MessageContext per request in it's
createMessageContext(...) method - it throws the request, response and other
stuff into the MessageContext as properties which you can then retrieve
later by property name...

        /* Save some HTTP specific info in the bag in case someone needs it
*/
 
/********************************************************************/
        msgContext.setProperty(Constants.MC_JWS_CLASSDIR, jwsClassDir);
        msgContext.setProperty(Constants.MC_HOME_DIR, getHomeDir());
        msgContext.setProperty(Constants.MC_RELATIVE_PATH,
                               req.getServletPath());
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLET, this );
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST, req );
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, res );
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETLOCATION,
                               getWebInfPath() );
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO,
                               req.getPathInfo() );
        msgContext.setProperty(HTTPConstants.HEADER_AUTHORIZATION,
 
req.getHeader(HTTPConstants.HEADER_AUTHORIZATION));
        msgContext.setProperty(Constants.MC_REMOTE_ADDR,
req.getRemoteAddr());


-----Original Message-----
From: Cory Wilkerson [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 2:02 PM
To: [EMAIL PROTECTED]
Subject: RE: Session Management


Maybe I didn't state my question clearly -- what I'm saying is that I'm
unsure of how to get to the HttpServletRequest object that is the foundation
of this service request from MessageContext or from a Handler.

Anyone?

-----Original Message-----
From: bin [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 2:04 PM
To: [EMAIL PROTECTED]
Subject: Re: Session Management


if u take a look at samples.userguide.example4.LogHandler you will see u
have to implement invoke( MessageContext msgContext ) in a Handler

however i was also wondering how does a Service get a reference to the
MessageContext?

thanks

bin

> All,
>
> Subsequent client requests to my service don't appear to be retaining
> state.  I'm certain that I'm missing something rather trivial here re:
> session management but I can't find any documentation regarding the
> matter.  That said, I have found the following tid bit:
> "It is up to some handler on the request chain to set up an appropriate
> Session implementation and attach it to the MessageContext with
> MessageContext.setSession() so that anyone who wants to use session
> semantics can get at it."
> I see the lovely AxisHttpSession object that can be constructed from an
> HttpServletRequest or HttpSession -- but I'm unsure of how to get to
> either/both through a handler OR a service.  Any input is warmly welcomed.
> Thanks!
> Cory
>
>
>
>

Reply via email to