You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Scott Nichol <sn...@scottnichol.com> on 2005/10/02 18:16:20 UTC

Re: httpsession with apache soap

You will notice in Constants.java:

  // Well-defined names for the 'bag' in SOAPContext
  public static String BAG_HTTPSERVLET = "HttpServlet" ;
  public static String BAG_HTTPSESSION = "HttpSession" ;
  public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
  public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
  public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;

The SOAPContext includes these methods for accessing the "bag":

    /**
     * Store something in the hold-all 'bag'
     */
    public void setProperty(String name, Object value) {
      bag.put( name, value );
    }

    /**
     * Look for something in the hold-all 'bag'
     */
    public Object getProperty(String name) {
      return( bag.get(name) );
    }

    /**
     * Remove something from the hold-all 'bag'
     */
    public Object removeProperty(String name) {
      return( bag.remove(name) );
    }

    /**
     * Return the entire list of 'names' in the hold-all 'bag'
     */
    public Enumeration getPropertyNames() {
      return( bag.keys() );
    }

MessageRouterServlet.java includes these snippets in doPost:

        reqCtx.setProperty( Constants.BAG_HTTPSERVLET, this );
        reqCtx.setProperty( Constants.BAG_HTTPSERVLETREQUEST, req );
        reqCtx.setProperty( Constants.BAG_HTTPSERVLETRESPONSE, res );

        if (session != null)
          reqCtx.setProperty(Constants.BAG_HTTPSESSION, session);

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Pramodh Peddi" <pp...@IMPRIVATA.com>
To: <so...@ws.apache.org>
Sent: Wednesday, September 28, 2005 3:13 PM
Subject: httpsession with apache soap


Hi,

 

I am using Apache Soap 2.3.1 on the 'server' side to receive soap
requests and respond. I want to validate the client requests using the
concept of session. I am using message style. So, all I have in the soap
method are Envelope, SOAPContext, SOAPContext objects. The soap client
is in C++, and HTML (not Java). 

 

Is it possible to retrieve HttpSession and use this to validate the
session of the client request? AND/OR is it possible to use the concept
of jsession? Are there any other ways to use the concept os session
validation (other than my own usage of database to store and validate
session - this would be the last option).

 

Thanks,

 

Pramodh.