We recently upgraded to Content Server 16.2.2 and I decided to run a performance test driver I had used on CS 10.5 in my local environment.
While the code ran faster, the authentication token expired faster than it had in 10.5.
CS is configured to expire 30 minutes after the last request.
We are using internal OTDS on our local dev boxes.
KB Article KB4638995 mentions using GetSessionExpirationDate to keep track of when the session will expire.
The KB article shows a C# snippet where GetSessionExpirationDate appears to take an auth argument ( GetSessionExpirationDate(ref auth); ).
That is not an option with the Java implementation.
I had tried this before with 10.5 and it threw an exception. It still does in 16.2
Here is the code that I've been using:
// SESSION_EXPIRY_DATE is of type XMLGregorianCalendar
// AUTHENTICATION_TIME logic is for my own session handling routine
// Call the AuthenticateUser() method to get an authentication token
try
{
System.out.print("Authenticating User...");
authToken = authClient.authenticateUser(USERNAME, PASSWORD);
System.out.println("SUCCESS!\n");
AUTHENTICATION_TIME = cal.getTime();
cal.setTime(AUTHENTICATION_TIME);
cal.add(Calendar.MINUTE, 30);
AUTHENTICATION_TIME = cal.getTime();
SESSION_EXPIRY_DATE = authClient.getSessionExpirationDate();
System.out.println("Session expires at " + dateFormat.format(SESSION_EXPIRY_DATE));
}
catch (SOAPFaultException e)
{
System.out.println("FAILED!\n");
System.out.println(e.getFault().getFaultCode() + " : " + e.getMessage());
e.printStackTrace();
return;
}
Here is the result:
Starting test at 2017/10/11 11:21:19
Authenticating User...SUCCESS!
FAILED!
ns0:Core.LoginFailed : ?
javax.xml.ws.soap.SOAPFaultException: ?
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at com.sun.proxy.$Proxy25.getSessionExpirationDate(Unknown Source)
at PerfTestCreatedoc.main(PerfTestCreatedoc.java:121)
I have also attempted using the refreshToken method with similar results.
Any feedback on what I am doing wrong, or where the issue may be?
Thanks...Brad