Solution for "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"


System.out.println("LOGGING IN NOW....");
enterpriseConnection connection = new enterpriseConnection();
loginResult = connection.login(userName, Password);
System.out.println("Succesfully logged IN");
connection._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());
SessionHeader sessionHdr = new SessionHeader();
sessionHdr.setSessionId(loginResult.getSessionId());
connection.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader", sessionHdr);

No comments:

Post a Comment