We have a Java application running on glassfish that makes callouts to WebServices hosted on our SF sandbox using the Partner WSDL and the SF Web Service Connector (wsc).
Yesterday it was working just fine. Today, after we did an Instance Refresh it stopped working. Whenever the Java tries to make the callout to a SF web method, we get the following error.
INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: D78G6B4m/rAhFmb5LxHR/jNoDfMCMBPWY0jIrCGnxyE= This error usually occurs after a session expires or a user logs out.
The login on SF from the Java application is successful. I can look at the information it returns (I can see it is connecting to the correct sandbox URL) and it's all correct. The login is done in the following way:
ConnectorConfig connectorConfig = new ConnectorConfig(); config.setAuthEndpoint("https://test.salesforce.com/services/Soap/u/34.0"); config.setUsername("email@example.com");
PartnerConnection partnerConnection = new PartnerConnection(config);
I can also see on the SF user page that the login was successful, and a user session is created on Session Management.
The sandbox refresh caused the sandbox instance and URL to be changed. (The number after CS was changed: company--preprod.cs108.my.salesforce.com)
I have tried to reset the token and modify the java code accordingly, to no avail. As I said, the login is successful, it's just the session ID that is messing things up.
In short, what I need to understand is why the login is returning an invalid session ID.
Any help is appreciated.