• Hardik Bodara
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have tried every example that I can find to access the api with C#. I am working behind a proxy and currently just using a Console application as no one will be using the application except for myself at the moment. The request sends fine however it does not and will not authenticate for some reason. I have been locked out of my account because of to many attempts. I created an app to configure remote access. Someone point me in the right direction of some good documentation. Please.

Here is my source code..

 

SforceService binding = null;
LoginFault loginFault = new LoginFault();
LoginResult loginResult = null;

binding = new SforceService();
binding.LoginScopeHeaderValue = new LoginScopeHeader();
//binding.Url = ConfigurationManager.AppSettings["sfLoginUrl"];//Config.SforceLoginUrl;
binding.Timeout = 60 * 1000 * 10;
try
{
loginResult = binding.login(ConfigurationManager.AppSettings["ProductionEmailId"], ConfigurationManager.AppSettings["ProductionPassword"]);
binding.Url = loginResult.serverUrl;
binding.SessionHeaderValue = new SessionHeader();
binding.SessionHeaderValue.sessionId = loginResult.sessionId;
log.Debug("LoginResult Urls : "+ binding.Url);
}
catch (System.Web.Services.Protocols.SoapException exception)
{
binding = null;
log.Error( "sforceService Object not set : " + exception.Message, exception);
}

 

 

 

i m getting the error like  "INVALID_LOGIN: Invalid username, password, security token; or user locked out."

 

when i login in my developer accouont it works fine.

but in my .net (c#) application it is giving me this error.

can anybody knows what could be the problem?

 

should i set that Url in sforceService Object?

 

what difference it makes when i set it?

 

I deployed it in live and having the same problem.

 

thanks in advance!

  • March 01, 2012
  • Like
  • 0