+ Start a Discussion
sususudiosususudio 

Invalid Session ID

Hi, I have developed an apex class and calling it from a vb.net web client, this works fine in Sandbox but in production I get the error
"invalid_session_id: invalid session id found in sessionheader: illegal session. session not found, missing session key" with the session ID not empty, that’s why I think my code is working just not redirected correctly.

Here is the code after I call the login (which works for the regualt API calls ):

            Dim UtilityCon As UtilityConService = New UtilityConService
            UtilityCon.SessionHeaderValue = New sfUtilityCon.SessionHeader
            UtilityCon.SessionHeaderValue.sessionId = _SessionID

Is there a setting in Production (I already unchecked the flag  ‘Lock sessions to the IP address from which they originated.’) that I missed or my code needs another org identification piece?

 

craigmhcraigmh

Are you hitting the right endpoint URL? If you are going to test.salesforce.com, that will only work with sandbox Session IDs, and will fail every time for a Session ID from production.