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

Since X-economicAppIdentifier added I get agreement not found exception

0

Hi, 

I have added the X-EconomicAppIdentifier and now get aggreemtn not found exception, for exact error see below stack.

I can connect but as soon as I try to do something with the session I get this error. 

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Economic.Api.Exceptions.AuthenticationException(E03200): The agreement doesn't exist (id=9ae03ad4-d7e9-494f-b4fc-0a787a3a421c)

at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:155)
at com.sun.proxy.$Proxy31.verifyXEconomicAppIdentifier(Unknown Source)
at com.kkkk.kkkk.exEconomicsIntegration.main(ExcelEconomicsIntegration.java:92)
Caused by: org.apache.cxf.binding.soap.SoapFault: Economic.Api.Exceptions.AuthenticationException(E03200): The agreement doesn't exist (id=9ae03ad4-d7e9-494f-b4fc-0a787a3a421c)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:114)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:800)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1592)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1490)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1309)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:133)
... 2 more
 
Best
/Kv
created May 5, 2016 by inf
100% Accept Rate

retagged May 17, 2016 by olej
Q 1 A 0 C 0
I have the same problem using CFX. If I put the custom headers after connect, it (naturally) refuses to log on due to missing X-EconomicAppIdentifier. If i put it before connect, it connects alright, but at the first call to a service operation, it fails with kv's error shown above. Please advise!

2 Answers

0
 
Best answer
It seems to be a bug in a previous version of CXF, so the fix i fairly straight forward. Update to the latest version of CXF (version 3.1.6 :), rebuild any generated code (eg. XML beans) and you should be up and running again.

 

Cheers Jan
answered May 16, 2016 by janriis
selected May 17, 2016 by olej
0
Hi Kv

The order of setting up the connection in the java client is crucial. Unfortunately our example has not been updated.
You should follow this order:

1. con.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
2. conn.connectAsAdminstrator(..);  //or conn.connect(..);
3. conn.setCustomHeader();
answered May 9, 2016 by olej
I have the same problem using CFX. If I put the custom headers after connect, it (naturally) refuses to log on due to missing X-EconomicAppIdentifier. If i put it before connect, it connects alright, but at the first call to a service operation, it fails with kv's error shown above. Please advise!
Visma e-conomic A/S
...