You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ku...@wipro.com on 2007/04/02 15:49:35 UTC

[Axis2] Sesion management [soapsession]

Hi,
 
I was trying out session management in Axis2 throught the help of doc
posted in
developers.com(http://www.developer.com/java/web/article.php/10935_36206
61_2). 
 
I deployed application in Soap session scope in Service Context.
 
I made followng changes as suugested in the article
 
1. Made change in service.xml to include soapsession.
 
2. Have included method init(), destroy() and a method for getting
ServiceContext in skelton class.
    
public void init(ServiceContext serviceContext) 
{
       System.out.println("In init() method");       
       serviceContext.setProperty("conferenceId" , new Integer(1000));

  }
 
      public void destroy(ServiceContext serviceContext) 
      {
            System.out.println("In destroy method");
           serviceContext.getProperties().remove("conferenceId");
      }
      
      
      private ServiceContext getServiceContext() {
        MessageContext messageContext = MessageContext
          .getCurrentMessageContext();
        ServiceContext serviceContext =
messageContext.getServiceContext();
        return serviceContext;
       } 
 
 
 
 
3. In the client stub I have added below line for managing the session
 
stub._getServiceClient().getOptions().setManageSession(true);  
 
 
I used the stub(same instance)  to invoke a functionality multiple
times. Each time functionality is invoked, init() method is getting
called (i,e) new instance of service is created for each request with
the same client instance in soap session.
 
Are there any more changes required to support soapsession. 
 
Please let me know how to proceed further for acheiving soap session
scope.
 
 
 
_________________________________________________
Thanks & Regards,
Vinodh
 



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: [Axis2] Sesion management [soapsession]

Posted by Rajith Attapattu <ra...@gmail.com>.
Here is an example

serviceClient.engageModule(new QName("addressing"));

Rajith

On 4/2/07, kumar.vinodh@wipro.com <ku...@wipro.com> wrote:
>
>  Rajith,
>
> How to engage addressing for Client? I have engaged the same for Server.
>
> _________________________________________________
> Thanks & Regards,
> Vinodh
>
>
>  ------------------------------
> *From:* Rajith Attapattu [mailto:rajith77@gmail.com]
> *Sent:* Monday, April 02, 2007 9:48 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: [Axis2] Sesion management [soapsession]
>
> Hi Kumar,
>
> Have u enabled addressing?
> Axis2 uses WS-Addressing to exchange the service group id to manage the
> soap session.
> So unless u have addressing engaged in both the client and service u want
> have session support.
>
> regards,
>
> Rajith
>
> On 4/2/07, kumar.vinodh@wipro.com < kumar.vinodh@wipro.com> wrote:
> >
> >  Hi,
> >
> > I was trying out session management in Axis2 throught the help of doc
> > posted in developers.com(http://www.developer.com/java/web/article.php/10935_3620661_2).
> >
> >
> > I deployed application in Soap session scope in Service Context.
> >
> > I made followng changes as suugested in the article
> >
> > 1. Made change in service.xml to include soapsession.
> >
> > 2. Have included method init(), destroy() and a method for getting
> > ServiceContext in skelton class.
> >
> > public void init(ServiceContext serviceContext)
> > {
> >        System.out.println("In init() method");
> >        serviceContext.setProperty("conferenceId" , new
> > Integer(1000));
> >   }
> >
> >       public void destroy(ServiceContext serviceContext)
> >       {
> >             System.out.println("In destroy method");
> >            serviceContext.getProperties().remove("conferenceId");
> >       }
> >
> >
> >       private ServiceContext getServiceContext() {
> >         MessageContext messageContext = MessageContext
> >           .getCurrentMessageContext();
> >         ServiceContext serviceContext = messageContext.getServiceContext
> > ();
> >         return serviceContext;
> >        }
> >
> >
> >
> >
> > 3. In the client stub I have added below line for managing the session
> >
> > stub._getServiceClient().getOptions().setManageSession(true);
> >
> >
> > I used the stub(same instance)  to invoke a functionality multiple
> > times. Each time functionality is invoked, init() method is getting called
> > (i,e) new instance of service is created for each request with the same
> > client instance in soap session.
> >
> > Are there any more changes required to support soapsession.
> >
> > Please let me know how to proceed further for acheiving soap session
> > scope.
> >
> >
> >
> > _________________________________________________
> > Thanks & Regards,
> > Vinodh
> >
> >
> > The information contained in this electronic message and any attachments
> > to this message are intended for the exclusive use of the addressee(s) and
> > may contain proprietary, confidential or privileged information. If you are
> > not the intended recipient, you should not disseminate, distribute or copy
> > this e-mail. Please notify the sender immediately and destroy all copies of
> > this message and any attachments.
> >
> > WARNING: Computer viruses can be transmitted via email. The recipient
> > should check this email and any attachments for the presence of viruses. The
> > company accepts no liability for any damage caused by any virus transmitted
> > by this email.
> >
> > www.wipro.com
> >
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>

RE: [Axis2] Sesion management [soapsession]

Posted by ku...@wipro.com.
Rajith,
 
How to engage addressing for Client? I have engaged the same for Server.
 
_________________________________________________
Thanks & Regards,
Vinodh
 

________________________________

From: Rajith Attapattu [mailto:rajith77@gmail.com] 
Sent: Monday, April 02, 2007 9:48 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Sesion management [soapsession]


Hi Kumar,

Have u enabled addressing?
Axis2 uses WS-Addressing to exchange the service group id to manage the
soap session.
So unless u have addressing engaged in both the client and service u
want have session support. 

regards,

Rajith


On 4/2/07, kumar.vinodh@wipro.com < kumar.vinodh@wipro.com
<ma...@wipro.com> > wrote: 

	Hi,
	 
	I was trying out session management in Axis2 throught the help
of doc posted in developers.com(
http://www.developer.com/java/web/article.php/10935_3620661_2
<http://www.developer.com/java/web/article.php/10935_3620661_2> ). 
	 
	I deployed application in Soap session scope in Service Context.
	 
	I made followng changes as suugested in the article
	 
	1. Made change in service.xml to include soapsession.
	 
	2. Have included method init(), destroy() and a method for
getting ServiceContext in skelton class.
	    
	public void init(ServiceContext serviceContext) 
	{
	       System.out.println("In init() method");       
	       serviceContext.setProperty("conferenceId" , new
Integer(1000));       
	  }
	 
	      public void destroy(ServiceContext serviceContext) 
	      {
	            System.out.println("In destroy method");
	
serviceContext.getProperties().remove("conferenceId");
	      }
	      
	      
	      private ServiceContext getServiceContext() {
	        MessageContext messageContext = MessageContext
	          .getCurrentMessageContext();
	        ServiceContext serviceContext =
messageContext.getServiceContext();
	        return serviceContext;
	       } 
	 
	 
	 
	 
	3. In the client stub I have added below line for managing the
session
	 
	stub._getServiceClient().getOptions().setManageSession(true);  
	 
	 
	I used the stub(same instance)  to invoke a functionality
multiple times. Each time functionality is invoked, init() method is
getting called (i,e) new instance of service is created for each request
with the same client instance in soap session.
	 
	Are there any more changes required to support soapsession. 
	 
	Please let me know how to proceed further for acheiving soap
session scope.
	 
	 
	 
	_________________________________________________
	Thanks & Regards,
	Vinodh
	 

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email. 

www.wipro.com
	





The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: [Axis2] Sesion management [soapsession]

Posted by Rajith Attapattu <ra...@gmail.com>.
Hi Kumar,

Have u enabled addressing?
Axis2 uses WS-Addressing to exchange the service group id to manage the soap
session.
So unless u have addressing engaged in both the client and service u want
have session support.

regards,

Rajith

On 4/2/07, kumar.vinodh@wipro.com <ku...@wipro.com> wrote:
>
>  Hi,
>
> I was trying out session management in Axis2 throught the help of doc
> posted in developers.com(
> http://www.developer.com/java/web/article.php/10935_3620661_2).
>
> I deployed application in Soap session scope in Service Context.
>
> I made followng changes as suugested in the article
>
> 1. Made change in service.xml to include soapsession.
>
> 2. Have included method init(), destroy() and a method for getting
> ServiceContext in skelton class.
>
> public void init(ServiceContext serviceContext)
> {
>        System.out.println("In init() method");
>        serviceContext.setProperty("conferenceId" , new
> Integer(1000));
>   }
>
>       public void destroy(ServiceContext serviceContext)
>       {
>             System.out.println("In destroy method");
>            serviceContext.getProperties().remove("conferenceId");
>       }
>
>
>       private ServiceContext getServiceContext() {
>         MessageContext messageContext = MessageContext
>           .getCurrentMessageContext();
>         ServiceContext serviceContext = messageContext.getServiceContext
> ();
>         return serviceContext;
>        }
>
>
>
>
> 3. In the client stub I have added below line for managing the session
>
> stub._getServiceClient().getOptions().setManageSession(true);
>
>
> I used the stub(same instance)  to invoke a functionality multiple times.
> Each time functionality is invoked, init() method is getting called (i,e)
> new instance of service is created for each request with the same client
> instance in soap session.
>
> Are there any more changes required to support soapsession.
>
> Please let me know how to proceed further for acheiving soap session
> scope.
>
>
>
> _________________________________________________
> Thanks & Regards,
> Vinodh
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>