Title: Message
I found that when working with sessions and multiple services that the session is service based.  To obtain a cross service session I had to retrieve the session id from the service and populate it into the other services.  The session ID is just a soap header and is available as an option value in the client engine.   The way we handled this was by creating a managing class (factory) which services were requested from, and when the services was being returned its session id was populated to enable the session across multiple services.
 
marcus
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 08, 2004 9:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Sessions across different services


Well, you seem to be making progress, Jochen.

I'm surprised that reusing the engine or service didn't work. I was looking at the 1.1. source, maybe you're using 1.2, which could be different. According to the "Building Web Services with Java" book, the session ID is stored in the Message Context, though that doesn't seem right to me. The book deals with Axis 1.2, which is annoying since I have to use Axis 1.1 and the source code for 1.1 definitely has the session ID being stored in the current engine.

Good luck.

Tony



Hi Tony,

thanks for your investigation!

Setting the Engine object did not work. Reusing the Service neither.

But reusing the Call object works! It seems that all information about
the session is stored in the Call object.

Since I have not found a way to do this via a handler, I have to find
out, how I can merge this with the generated classes.

Many thanks for your help
Jochen


[EMAIL PROTECTED] wrote:

> OK, Jochen. Following your reply, I had a quick look at the Axis source
> and it seems as though a new AxisClient is created for each Service
> object. The session ID is stored in the AxisClient so I guess you'd need
> to use the same Service object for all service calls. This may not be
> normal behaviour but I think it is possible. Alternatively, the Service
> object has a setEngine() method, so you might be able to get away with
> something like:
>
> nextService.setEngine(previousService.getEngine());
>
> before making the call.
>
> Tony
>
>
>
> Hi Tony,
>
> I think there is some misunderstanding. I'm requesting all services from
> the same JVM.
>
> First I create a Service and a Call object for the first service and
> then for the second.
> On the server-side I'm storing an object in the session and access it on
> each request.
> When accessing the second service, the object is not in the session
> (return value is null).
>
> Jochen
>
> [EMAIL PROTECTED] wrote:
>
>
>>Jochen,
>>
>>I suspect that you would have to keep the client JVM alive and make all
>>service calls from that JVM, in order to maintain the session across
>>different service calls. Using the HTTP sessions might work better,
>
> though
>
>>I doubt it. Other than that, you'd probably have to write your own
>
> session
>
>>handler (maybe as a subclass of the SimpleSessionHandler) that persisted
>
>
>>the session ID on the client in some way.
>>
>>Tony
>
>
>
>


Reply via email to