Web service session timeout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2007 11:27 PM
I realized that the web service session times out with the web-client session.
Let's say I set the session-timeout to 2 minutes in the web.xml, my web service session only lasts for 2 minutes.
I thought the web service ticket did not expire by default (ticketsExpire is set to false in authentication-service-context.xml)
I used the following code for testing and the get(Predicate) only executes twice before I get the WSSecurityEngine: Callback supplied no password … error:
AuthenticationUtils.startSession(USERNAME, PASSWORD);System.out.println("Session started."); try { for (int i = 0; i < 5; i++) { Reference reference = new Reference(STORE, null, xpath); Predicate predicate = new Predicate( new Reference[] {reference}, STORE, null); Node[] nodes = WebServiceFactory.getRepositoryService().get(predicate); Thread.sleep(1 * 60000); } } finally { // End the session AuthenticationUtils.endSession(); System.out.println("Session ended."); }}
Someone knows what is going on?
Thanks!
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2007 11:39 AM
No I'm not entirly sure what's going on here. I think I'm going to need to try this out and see what behaviour I get.
I'll get back to you when I've made some progress.
Cheers,
Roy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2007 09:50 AM
Seems when the session time out occurs the password request callback fails.
Ben.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2007 05:42 AM
That all makes sense and is what you want to happen although I'm not sure why this didn't occur in previous Alfresco versions.
So.. my question is what would be the best method to handle this? Force the session to be kept alive or listen (somehow) for session death and then re-establish?
If there's a standard way to do this please forgive my ignorance.
ta,
Ben.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2008 08:02 PM
…So.. my question is what would be the best method to handle this? Force the session to be kept alive or listen (somehow) for session death and then re-establish?
If there's a standard way to do this please forgive my ignorance.
Ben, did you find a solution for the best method in this situation? I have the same query.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2009 09:01 AM
I have a Webservice based Java app that stays alive (or rather: should stay alive) for days.
Has anyone tested setting the session-timeout to 0 in web.xml?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2009 10:41 AM
I set the session-timeout of the Alfresco web-app to 0 in web.xml and it seems to do the trick.
My connection stays open for days with nonstop datatraffic from downloading files.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2010 08:13 PM
I had problem with my web service session timing out so I started to do a little bit of testing.
I realized that the web service session times out with the web-client session.
Let's say I set the session-timeout to 2 minutes in the web.xml, my web service session only lasts for 2 minutes.
I thought the web service ticket did not expire by default (ticketsExpire is set to false in authentication-service-context.xml)
I used the following code for testing and the get(Predicate) only executes twice before I get the WSSecurityEngine: Callback supplied no password … error:
Code: Select all
AuthenticationUtils.startSession(USERNAME, PASSWORD);
System.out.println("Session started.");
try
{
for (int i = 0; i < 5; i++)
{
Reference reference = new Reference(STORE, null, xpath);
Predicate predicate = new Predicate(
new Reference[] {reference}, STORE, null);
Node[] nodes =
WebServiceFactory.getRepositoryService().get(predicate);
Thread.sleep(1 * 60000);
}
}
finally
{
// End the session
AuthenticationUtils.endSession();
System.out.println("Session ended.");
}
}
Anyone can contribute something or any ideas that could fix this matter?
Im looking forward for a very positive response!
tHank you!!
how to hypnotize people
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2010 02:58 AM
As a reply to my own question:
I set the session-timeout of the Alfresco web-app to 0 in web.xml and it seems to do the trick.
My connection stays open for days with nonstop datatraffic from downloading files.
Hi ThierensBart thanks for that help that's really good!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2010 07:26 PM
AuthenticationUtils.startSession(username, password, timeoutInterval);
…where timeoutInterval is the age of your ticket in milliseconds.Then you can check if your ticket is timed out or not with:
AuthenticationUtils.isCurrentTicketTimedOut()
It will return true if the ticket is expired. In this case you might want to destroy the session created during a valid login operation.If timeoutInterval is not set it will return false.
