API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

AuthenticationException - throwed non deteministic

+2

Hello,

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();
                service.setMaintainSession(true);
                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();
                service.disconnect();

 

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?

 

Best Regards

Niels

 

 

 

 

 

created Aug 12, 2013 by boldt
0% Accept Rate
Q 5 A 2 C 1

2 Answers

0

Hi Niels,

I am having the same problem. I have some code which worked well for many months. But since around 5pm this afternoon I am seeing "User is not authenticated" maybe every 3rd or 4th connection. Sometimes the error occurs very quickly after the connection (i.e. too short a period for a timeout to occur).

 

Example:

Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. (id=ce200e3e-2d8e-444d-afac-faa460b654d2)
AxisFault
 faultSubcode: 
 faultString: Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. (id=ce200e3e-2d8e-444d-afac-faa460b654d2)
 faultActor: 
 faultNode: 
 faultDetail: 
{http://xml.apache.org/axis/}stackTrace:Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. (id=ce200e3e-2d8e-444d-afac-faa460b654d2)
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
 
 
Hopefully someone from E-conomic will look into this and come up with a solution.
 
 
Edit 17/08/2013 14:40:
I can confirm that this problem now seems to have been resolved. The e-conomic "hotfix" has done the trick!
 
answered Aug 13, 2013 by mrbriandarnell
edited Aug 17, 2013 by mrbriandarnell
I just wanted to chime in and say I'm having this issue as well. I am in contact with support and waiting for a response from API support. Code that has been working fine for a long time is now getting this exact error at seemingly random calls to the SOAP API.
I have been having this problem as well. I mailed the api support and they told me they did not change anything during the time the errors started occuring for us. (2013/08/09 13:23:25 (CEST))

This is a big problem for us, and we have run a tight integration with e-conomics without this problem for several years!

Please, if any e-conomic staff see this.. please look into it more. This must be caused at your end!
Albert, The time and date matches more or less perfectly with the first time one of our clients contacted us with this issue. This only strengthens the case that there is something on E-conomics end.
I just got an email confirming that they are looking in to the problem, which is progress.
I have gotten a mail stating they have applied a hotfix to fix this problem, which indeed seems to have fixed it.
0

Hi

After more debugging I located the problem, sort of

By sending my request over a proxy I could see actual content and I noted that suddenly axis1 add some extra cookies like

Cookie: ADRUM_37_0_0=clientRequestGUID%3ad127e666-7e28-49c3-898a-9c84817e33bb
Cookie: ADRUM_37_0_1=btId%3a174352

to the request sent to e-conomic. The original Asp.Net session cookie is still there, but probably the server can't figure out how to read it correctly because there suddenly is 3 cookie headers in the request instead of the original one.

I'm trying to fix by manually controlling cookies in axis1, but have a hard time figuring out howto. Any one with experience in this.

 

Best Regards

Niels

answered Aug 13, 2013 by boldt
Visma e-conomic A/S
...