I’m trying to integrate to an online service called E-conomic (http://www.e-conomic.com).
They have a nice Web Service to control thir product. After importing their WSDL in a Java Library and copying their example in an agent i can connect and authenticate.
But when i try to do something something with the service - it tells me that I’m not authenticated. All in all - the session is not maintained.
The E-conomic example:
import javax.xml.rpc.ServiceException;
import com.e_conomic.*;
public class UserApp {
public static void main(String args){
EconomicWebServiceLocator locator = new EconomicWebServiceLocator();
locator.setMaintainSession(true);
EconomicWebServiceSoap session = locator.getEconomicWebServiceSoap();
session.connect(123456, ”username”, ”password”);
// Application code.
session.disconnect();
}
}
I have made a java agent with the included Java Library made from the E-conomic WSDL.
It looks like this:
import lotus.domino.*;
import javax.xml.rpc.ServiceException;
import com.e_conomic.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
EconomicWebServiceLocator locator = new EconomicWebServiceLocator();
locator.setMaintainSession(true);
EconomicWebServiceSoap ecsession = locator.getEconomicWebServiceSoap();
ecsession.connect(123456, "<username>", "<password>");
// Application code.
InvoiceHandle invoice = ecsession.invoice_FindByNumber(123);
ecsession.disconnect();
} catch(Exception e) {
e.printStackTrace();
}
}
}
Which will not complie because of this line:
locator.setMaintainSession(true);
It tells that it cannot find the symbol - that it is not there. As far as I understand it sould be a property of the client side connection.
How do I maintain the session?
What am I doing wrong?
I am not that great developing Java - can anybody help me?
Best regards,
Christian Gravgaard,
IBM Certified Advanced Application Developer