Results 1 to 3 of 3

Thread: SessionID for Axis servlet request

  1. #1
    Join Date
    Jun 2005
    Location
    Plano, TX, USA
    Posts
    4

    Default 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. #2
    Join Date
    Jun 2005
    Location
    Plano, TX, USA
    Posts
    4

    Default Figured out

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

  3. #3
    Join Date
    Aug 2008
    Location
    US
    Posts
    1

    Default 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());

Similar Threads

  1. OpenSessionInView and portlet support
    By garpinc2 in forum Web Flow
    Replies: 31
    Last Post: Apr 9th, 2010, 11:12 AM
  2. Replies: 17
    Last Post: Jan 2nd, 2007, 01:43 PM
  3. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  4. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  5. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •