axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@winterthur.ch>
Subject AW: [Axis2 1.1 RC2]Can't manage session
Date Mon, 27 Nov 2006 10:14:57 GMT
Hi axis2 session-management-team

Can someone from this axis2 team explain me why a first client thread can not 
continue to operate because it's service group id is no longer valid at the server
as soone as the second client starts working? And the second client fails with the
same error "invalid service group ID" as soon as the third client starts.


I need to have 20 clinets running in 20 threads, each shall have it's own session
which must last as long as ths clinets thread exist, talking to 20 instances (objects)
of the same service-class. This service objects must all be state-fule and keep alive
until the client cancels the session. This service objects must be statefull to
keep for the livetime of the session a CORBA IOR or any other unique reference to 
a unique external background process?

Is there documentation about when and how axis2 creates an instance of a object and
relates it to a session?


NOTE:
The example below works with scope=soapsession but as said, it works only as long as 
only one client works, and it dies when the second client stzarts. Therefore I beleave 
there is a bug in AXIS2.


Josef 


-----Urspr√ľngliche Nachricht-----
Von: Stadelmann Josef [mailto:josef.stadelmann@winterthur.ch]
Gesendet: Mittwoch, 22. November 2006 12:11
An: axis-user@ws.apache.org
Betreff: AW: [Axis2 1.1 RC2]Can't manage session


Hi Sanka, Team

Thanks for your help. I have read 
http://www.developer.com/java/web/print.php/3620661
all about axis2 sessionmanagement.

I am running axis2-1.1-snapshot from 25th october

I have read your answers below. And have attched my 
client and server code plus service.xml and axis2.xml from the
client side user repository (used to engage modules).


I toke the RESTClient initially but then realised that for session mgmt
I had to add SOAP Headers, so I changed it until it has become a SOPAClient!


When I EXECUTE the first RESTClient from NetBEans 3.6 then the server returns 
wsa:ReferenceParameter etc. etc. I ionvoke the start method! After the start method
there are consecutive echo messgae sent/received for 1000 loops. 


My client uses the same sender object to invoke and remain in the same session. 
And the dialog goes over because I want to test some several 1000 loops to the 
server and back.

NOTE: the first RESTClient works very well with about 10 to 40 msg/sec.
up to the loop limit of 1000 when it terminates correctly


Running the first RESTClient ....
All works well until I lauch the same RESTClient code in a second thread from
within NetBeans. The second client starts and receives it's wsa:ReferenceParameter.

And then the second client goes on for the same 1000 loops, correctly looping to 
the server and back with data. 

Note: The second client works well with about 10 to 40 msg/sec!


BUT NOW: shortly after the second client is operating, the first client
bails out with an exception.

Invalid Service Group Id urn:uuid:0715218C458CA2825511641843495561

it seams that the old service grouop id is given up/lost and that would
explain that my first client runs into the error above, while the second
continus to work perfectly untill I launch a third client. then the second
dies with the same error and so on.

How can I have two clients each talking to it's real own session-object
I want to have two objects, two instances of the same MyService.class

I really don't know how to do that. Also one can see that when the service
gets started it keeps a start-time-stamp. When a next servie starts then
I would exopect that client no 2 brings a different start-time-stamp back.

But that is never the case. So including the Real RESTClient, I have for sure
only one MyService.class instance and all client threads are requesting from 
the same instanciated service object.


Where can I learn more about AXIS2 session managment? How is that doen?

Any help welcome
Josef



-----Urspr√ľngliche Nachricht-----
Von: Sanka Samaranayke [mailto:ssanka@gmail.com]
Gesendet: Mittwoch, 8. November 2006 15:33
An: axis-user@ws.apache.org
Betreff: Re: [Axis2 1.1 RC2]Can't manage session


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Takanori Suzuki wrote:
> I try to manage a session, but it is failed.
>
> I used the pojo sample 'AddressBook' which is in RC2. The entry is
> not keep when I change  as follows:
>
>
> Try : SOAP Session
>
> 1. services.xml <service name="AddressBookService"
> scope="soapsession">
>
> 2. AddressBookRPCClient Options options =
> serviceClient.getOptions(); options.setManageSession(true);

To enable SOAP sessions, you need to do little more work than that,

a) you need to engage addressing module since the SOAP sessions
are maintained with the aid of <wsa:ReferenceParamenters> addressing
header.

RPCServiceClient serviceClient = new RPCServiceClient(..);
serviceClient.engageModule(new QName("", "addressing-1.1");


b) you need to set the soap:Action for the appropriate methods.

for findEntry()

options.setAction("urn:findEntry");

for addEntry()

options.setAction("urn:addEntry");


c) In this case you need to invoke findEntry(..) as the starting point
since
you need to get session info from the server when you about to start a
SOAP session.

Therefore you need to invoke the findEntry(..) to start the SOAP session
and then any method in any sequence you want.


Best,
Sanka
>
>
> Try : Transport Session
>
> 1. services.xml <service name="AddressBookService"
> scope="transportsession">
>
> 2. AddressBookRPCClient Options options =
> serviceClient.getOptions(); options.setManageSession(true);
>
> 3. axis2.xml <parameter name="manageTransportSession"
> locked="false">true</parameter>
>
>
> It failed in both. What's wrong?
>
> Thanks, Takanori Suzuki
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For
> additional commands, e-mail: axis-user-help@ws.apache.org
>
>


- --
Sanka Samaranayake
WSO2 Inc.
T:+94-77-3506382 F:+94-11-2424304

http://sankas.blogspot.com/
http://www.wso2.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFFUeqD/Hd0ETKdgNIRArCdAJ4tXzCiHrlzIdByMjkktrnPR3i/2QCdHd6Q
/Kz/baOzDF/HciAi/YMyjqE=
=mYgK
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message