+ Start a Discussion

Solve the Error: "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"??

hi I m using follwing c# coding.. In runtime i got error  "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"...


getClassId.getClassIdService getClassIdObj = new getClassId.getClassIdService();
getClassIdObj.SessionHeaderValue = new getClassId.SessionHeader();
getClassIdObj.SessionHeaderValue.sessionId = sessionId;

if (ddlClassname.SelectedIndex != 0)
string name = ddlClassname.SelectedItem.Text.ToString();

getClassId.Class__c getClassIdResponse = getClassIdObj.getClassIdFromClassname(ddlClassname.SelectedItem.Text.ToString());
Session["ClassName"] = getClassIdResponse.Name;
Session["ClassId"] = getClassIdResponse.Id;
Session["ClassDay"] = getClassIdResponse.Day_of_Week__c;
lbError.Visible = true;
lbError.Text = "You must select class name!";

Best Answer chosen by Admin (Salesforce Developers) 
Niket SFNiket SF

Hello Riyaj,

   If you are using the C#. In the login call you will get the Session ID in the Login Result. Please check that the SessionId that you are providing and the comes via Login Result are same.


Thank you