You need to sign in to do that
Don't have an account?
NVALID_SESSION_ID using partner/enterprise wsdl for two different SF users
Hi,
I followed example given on this link : http://wiki.developerforce.com/page/Force.com_for_ASP.NET_Developers
it worked perfectly for my SF developer account.
But when I tried the same with different SF credentials without changing web service reference (as other account also had apex web service methods to pull leads detail) it gave me below error (I passed correct username, password with access token for both users).
INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key:
My question is : how can my .NET app authenticate multiple SF users using same WSDL file?
If not then what is the other way around?
Thanks in advance!!
Finally I got it!!
LoginResult lr = sforcebinding.login(_userId, _passwordWithToken);
......
......
int index1 = lr.serverUrl.IndexOf(@"/services/");
int index2 = getLeadInfo.Url.IndexOf(@"/services/");
if (index1 == 0 || index2 == 0)
{
Response.Write("Invalid URL in bindings");
return;
}
getLeadInfo.Url = lr.serverUrl.Substring(0, index1) + getLeadInfo.Url.Substring(index2);
All Answers
If you're calling a custom apex web service, then you'll need to update the Url property with the instnace/hostname of the current user, as it'll contian the instance url of the user that originally downloaded in the wsdl.
Thanks Simon,
Can you provide me more info of the same. Any article with example would be very helpful!?
Finally I got it!!
LoginResult lr = sforcebinding.login(_userId, _passwordWithToken);
......
......
int index1 = lr.serverUrl.IndexOf(@"/services/");
int index2 = getLeadInfo.Url.IndexOf(@"/services/");
if (index1 == 0 || index2 == 0)
{
Response.Write("Invalid URL in bindings");
return;
}
getLeadInfo.Url = lr.serverUrl.Substring(0, index1) + getLeadInfo.Url.Substring(index2);