You need to sign in to do that
Don't have an account?
Sandbox login failing...
I am an enterprise customer and can log into the production environment through the API. Today I created a sandbox (I guess developer version) of my production environment. I am unable to log into the sandbox version. I logged into the sandbox version through a web portal and generated an sercurity token. I am using username.sandboxname and passwordtoken. Here is the code:
private bool Login(string strUsername, string strPassword, string strToken)
{
// Timeout after a minute
_sforceService.Timeout = 60000;
// Try loggin in
LoginResult loginResult;
try
{
loginResult = _sforceService.login(strUsername, strPassword + strToken);
}
catch (SoapException e)
{
return false;
}
if (loginResult.passwordExpired)
return false;
// Reset the endpoint of the service to the virtual server instance that is servicing our organization
_sforceService.Url = loginResult.serverUrl;
// Set the persistent SOAP header.
_sforceService.SessionHeaderValue = new SessionHeader();
_sforceService.SessionHeaderValue.sessionId = loginResult.sessionId;
return true;
}
You need to change the host name, but keep the rest of the URL the same, something like xxx.url = "https://test.salesforce.com/services/Soap/c/19.0"
All Answers
Did you download a sandbox WSDL and use that, or did you update your code to change the URL for the login request to use test.salesforce.com ?
Hi Simon, thanks for the quick reply. No I could not download the WSDl from the sandbox version... it was trying to generate a google something or other. Did not respond the same way as production.
No I did not change the URL... when I did the following command _sforceService.Url = "test.salesforce.com"; I got a completely different expection.
You need to change the host name, but keep the rest of the URL the same, something like xxx.url = "https://test.salesforce.com/services/Soap/c/19.0"
Thanks Simon!