axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vaibhav Arya" <vaibhav.a...@otssolutions.com>
Subject [axis2-sessionmanagement]
Date Thu, 21 May 2009 08:18:22 GMT
Hi Everyone,

 

I want to maintain soap session so that client should be in session for 30
minutes.

I'm trying to put some values in ServiceContext in so that I could fetch
those values in later requests, but at every request the values in service
context are shown null.

Also 

 

I can get the value in service Context when I execute
'sender.sendReceive(createPayLoad())' twice in same request.

 

Can any body please tell me what to do to get this job done.

My code on client side is as follows,

 

                                    ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem
("C:/apache-tomcat-5.5.27/webapps/v1a/WEB-INF","C:/apache-tomcat-5.5.27/weba
pps/v1a/WEB-INF/conf/axis2.xml");               

                                    ServiceClient sender = new
ServiceClient(configContext, null);

                                    sender.engageModule("addressing");

                                    Options opts = new Options();

                                    opts.setTo(new
EndpointReference("http://localhost:8080/v1a/services/V1AWebService"));   

                                    opts.setAction("urn:validateUser"); 

                                    opts.setManageSession(true);

                                    opts.setTimeOutInMilliSeconds(600000);

                                    sender.setOptions(opts);


                                    OMElement ele =
sender.sendReceive(createPayLoad());   

 

My server side code to fetch values in session is,

 

           MessageContext messageContext =
MessageContext.getCurrentMessageContext ();

           System.out.println ("getLastTouchedTime" +
messageContext.getLastTouchedTime ());

           ServiceContext sc = messageContext.getServiceContext ();

           Object incValue = sc.getProperty ("VALUE");

           if (incValue!= null) {

               System.out.println ("incValue: " + (String) incValue);

           }else{

               System.out.println ("setting value for incValue: " + (String)
incValue);

               sc.setProperty ("VALUE", "Value is existing");

           }

 

I would highly appreciate any quick help.

 

Thanks & regards

 

Vaibhav Kr. Arya

 



===================================================================================================
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted
with it are confidential and/or privileged. They are intended solely for the use of the intended
recipient. The content of this e-mail and any file or attachment transmitted with it may have
been changed or altered without the consent of the author. If you are not the intended recipient,
please note that any review, dissemination, disclosure, alteration, printing, circulation
or Transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited
and may be unlawful. If you have received this e-mail or any file or attachment transmitted
with it in error please notify OTS Solutions at info@otssolutions.com
===================================================================================================

Mime
View raw message