I am trying to use webservice to read account data and I have written a small piece of Java code just to try to log in.
try{
EconomicWebServiceLocator locator = new EconomicWebServiceLocator();
EconomicWebServiceSoap session = locator.getEconomicWebServiceSoap();
try{
String cSuccess = session.connect(1111, "myuser", "mypassword");
if(cSuccess==""){
JOptionPane.showMessageDialog(null, "Not connected");
}else{
JOptionPane.showMessageDialog(null, "Connected");
}
ArrayOfAccountHandle Accounts = session.account_GetAll();
I am getting a connection because cSuccess contains a string with an ID and the connection has been validated by e-conomic suppport.
I get an error in the line: ArrayOfAccountHandle Accounts = session.account_GetAll();
The error is:
RemoteExceptionEconomic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. Access denied. {id=174395972}.
The guide "e-conomic_API_1.4.5.pdf" on page 8 has an example on how to connect to the webservice
The line locator.setMaintainSession(true); in the example is not a part of my code as my compiler returned the error:
"The method setMaintainSession(boolean) from the type Service is not visible."
I guess my connection is disconnected if locator.setMaintainSession(true); is not set.
What am I missing in my code piece to get it to work?
/MSH

