Hi, You can access the MessageContext from your service implementation as follows. MessageContext incomingContext = MessageContext.getCurrentMessageContext();
You can get the ServiceContext from it[1].. Then you can use setProperty[2] to store a name value pair in the session. You can access them using getProperty. I don't think you'll need to use the init() and destroy() methods. thanks, Thilina [1] http://ws.apache.org/axis2/1_3/api/org/apache/axis2/context/MessageContext.html#getServiceContext() [2] http://ws.apache.org/axis2/1_3/api/org/apache/axis2/context/AbstractContext.html#setProperty(java.lang.String,%20java.lang.Object) On 9/26/07, Golam Chowdhury <[EMAIL PROTECTED]> wrote: > Thanks Thilina for your reply, > > Wondering, if you could give me some example. > > I know to enable the session I have to add the <service name="foo" scope=" > transportsession"> </service>" in the service.xml > > > > ??? using serviceContext how do I access the session and store information > in the session. > > public void init(ServiceContext serviceContext) { > > } > > public void destroy(ServiceContext serviceContext) { > } > > Thanks very much for all your help. > > Golam > > -----Original Message----- > From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 25, 2007 7:33 PM > To: [email protected] > Subject: Re: AXIS2 session create, access, and invalidate > > Hi, > You will need to use something like Axis2 transport sessions or SOAP > session (which requires ws-addressing support in the client side).. > Then you can store your authentication data in the Axis2 > ServiceContext object. > > Following article will give you more information about Axis2 sessions. > http://www.developer.com/java/web/article.php/3620661 > > thanks, > Thilina > > On 9/25/07, Golam Chowdhury <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have created a web service that will verify the user and once the user > is > > verified I will give the user some requested data. > > > > > > Problem: > > > > -Like to know how to create a session in the server side to store > > authentication information. > > -Like to know how to get the session in the server side in order to get > the > > authentication information. > > > > > > What I would like to do: > > > > -Once the user is verified, I would like to create a session and store the > > authentication information in the session. > > -Once the user request for more data, I would like to use the session to > > verify if the user is valid. > > -Once I give the requested data, I would like to invalidate the session so > > the user have to re-login. > > > > > > Any pointer is greatly appreciated. > > > > Thanks > > Golam > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Thilina Gunarathne - http://thilinag.blogspot.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thilina Gunarathne - http://thilinag.blogspot.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
