You need to sign in to do that
Don't have an account?

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Hello,
I believe this is only recent, but I am no longer able to perform API actions against my development install using code that hasn't changed in quite some time. When I run the code listed below, I get a error on the "Describe Object" call that says "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session". It looks as though I'm getting a valid session ID back from the login call, but the subsequent API call doesn't seem to like it.
The interesting thing is that I have a QA org that's on NA1 (my dev org is also on NA1) that has no problems with the code below. Also, this problem is only happening for my dev org when I run the code from our corporate environment. If the code runs on our production environment (which have different IP ranges and are locate outside of our corporate office), then it works properly as well.
Is is possible that there is some sort of configuration set in my dev org that doesn't agree with the code below as it's run from our corporate environment? I've played around with the "Lock sessions to the IP address from which they originated" setting in my dev org, but it didn't seem to do anything.
Here is the code I am running that seems to work for every other install except my dev org:
Dim sfdcService As New SforceService
Dim loginResult As New LoginResult
sfdcService.SessionHeaderValue = New SessionHeader
loginResult = sfdcService.login(username, password)
sfdcService.Url = loginResult.serverUrl
sfdcService.SessionHeaderValue.sessionId = loginResult.sessionId
Dim results As SForce.DescribeSObjectResult = sfdcService.describeSObject("Lead")
Any help would be greatly appreciated.
Thank you,
Scott
All Answers
Hi,
Where can i check that ?
Thanks
Anish
I'm facing the same problem. Code that used to work fine, starts throwing an "Invalid Session ID found in SessionHeader" error. Were you able to solve this issue?
I have brand new code but getting the same reply trying to execute line of apex code from javascript:
Examples from pdf cookbook do not work for me either.
This is my class:
global class TNAPIAuth { WebService static String token() { return 'it works'; } }
And this is my page:
<script type="text/javascript" src="/js/functions.js"></script> <script type="text/javascript" src="/soap/ajax/15.0/connection.js"></script> <script type="text/javascript" src="/soap/ajax/15.0/apex.js"></script> ........... function doSomething() { try { result = sforce.apex.execute("TNAPIAuth", "token", {}); alert('no problems - it is working'); }catch(error) { alert(error); } };
Is anyone able to call apex from java on http(s)://c.na6.visual.force.com ?
Hi Aniche,
Iam facing the same prob in my Org where the extraction of records through Batch process stop in the middle .When i see the logs , i see this error Invalid session Id, missing session key.
This error comes very rarely and unable to find a solution for this.
Did you manage to get a solution for this ?
Thank you in Advance.