I'm working on a integration using the api and my client app is running in java
I often get an AuthenticationException when calling the api
The message is something like
java.lang.RuntimeException: Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. (id=af8177c4-5cff-4992-9974-b84012c64d30)
The client app is a web app so for each request the user do on our app, we create a e-conomic session and uses it for the entire request and releases the connection when the request ends.
The code used to create a session is
EconomicWebServiceLocator service = new EconomicWebServiceLocator();
session.set( service.getEconomicWebServiceSoap() );
log.debug("connecting to economic with agreement:"+Integer.parseInt(agreement)+":user:"+user+":password:"+password);
log.warn( "connecting, got response " + session.get().connect(Integer.parseInt(agreement), user, password) );
and when a request is done, we release the connection with code like
log.info("disconnecting from e-conomic");
EconomicWebServiceSoap service = session.get();
The problem is that I'm getting the authentication exceptions in a totally non deterministic way. I can create a connection, then do a couple of successfull request to e-conomic and then I suddenly get the authentication exception. We do multiple requests to e-conomic in one session. Its like the session is killed behind myback
If we try again a couple of seconds later everything works fine and we can complete an entire user request without any errors. We are careful to disconnect all e-conomic session so we do not have any hanging around. Its never the connect request that fails.
Any suggestions what to do?