Hi Thomas -   
once the first service call has returned, use the getSessionID method described below 
to obtain the session identifier.  the identifier can then be 'attached' to the second 
service using the setSessionID method.

static public void setSessionId(Service oService, Long oId) {
  AxisEngine engine = oService.getEngine();
  engine.setOption(SimpleSessionHandler.SESSION_ID,oId);
}

static public Long getSessionId(Service oService) {

  AxisEngine engine = oService.getEngine();
  return (Long)engine.getOption(SimpleSessionHandler.SESSION_ID);
}



maintaining sessions across distinct Service instances (and other useful tips and 
tricks) are presented in an upcoming Axis book by O'reilly, "Programming Apache Axis". 
 You can pre-order the book on Amazon.
   



cheers,

Chris Haddad
lead author of Programming Apache Axis
http://cvs.apache.org/~haddadc


---------- Original Message ----------------------------------
From: "Dorner, Thomas" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Wed, 24 Mar 2004 14:58:28 +0100

>       Hi all,
>
>       I use Axis SimpleSessionHandler in my Stub to handle Sessions for my
>SOAP-Messages
>
>       My Problem is:
>
>       I have a client which make a login at WebService1 and get a session
>for this loggin
>
>       and the same client call a Service2 and should set the Session form
>Service1 for this call.
>
>       How can i do this?????????? :((((
>
>       I cant get a MessageContext in my Client!!!
>       --> MessageContext context = MessageContext.getCurrentContext();
>       context = null
>       --> only works on Serverside!!!
>
>       and i cant get the SOAPHeader from the stub!!!
>       SOAPHeaderElement[] elem = binding.getHeaders();
>       elem = []
>
>       Is there anybody out there, who can help me?
>
>       Tomi
>
>

Reply via email to