Announcement Announcement Module
Collapse
No announcement yet.
SessionID for Axis servlet request Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SessionID for Axis servlet request

    Hi all,

    I use Spring DispatcherServlet and a controller to handle incoming requests and bond/retrieve user session objects with httpsessions. Now I want to expose my api methods as web service by using axis. I created a class:

    Code:
    public class RemoteApiEndPoint extends ServletEndpointSupport implements RemoteApiService
    The methods in the class will call my corresponding api methods. However, I need to get session id from the request handled by axis servlet to retrieve user session object (for access control, user settings, and so on). I checked ServletEndpointSupport java doc and could not find a way to get httprequest object.

    Could anyone help me with the issue? Thanks,
    ZJ

  • #2
    Figured out

    HttpSession httpSession = ((AxisHttpSession) MessageContext.getCurrentContext().getSession()).g etRep(); :lol:

    Comment


    • #3
      Try this

      org.apache.axis.MessageContext context = org.apache.axis.MessageContext.getCurrentContext() ;
      HttpServletRequest req = (HttpServletRequest)context.getProperty(org.apache .axis.transport.http.HTTPConstants.MC_HTTP_SERVLET REQUEST);
      System.out.println(req.getSession(true).getId());

      Comment

      Working...
      X