function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohit MohanMohit Mohan 

First Apex-api program

Hi ,

I am writing my first Apex -API program in .NET (C#).The program as follows:-

private void button1_Click(object sender, EventArgs e)
       {
           
           sForce.SforceService abc = new Jaggu.sForce.SforceService();
           sForce.Account objAccount = new Jaggu.sForce.Account();
           //Set several properties

           // Invoke the login call and save results in LoginResult

          // sForce.Proxy = System.Net.WebProxy.GetDefaultProxy();
           sForce.LoginResult lr = abc.login("******", "");
           // Reset the SOAP endpoint to the returned server URL

           abc.Url = lr.serverUrl;// "https://www.salesforce.com/services/login.jsp";

           // Create a new session header object
           // Add the session ID returned from the login

           abc.SessionHeaderValue = new sForce.SessionHeader();
           abc.SessionHeaderValue.sessionId = lr.sessionId;
           sForce.GetUserInfoResult userInfo = lr.userInfo;
           objAccount.Name = "John Abhraham ";
           objAccount.Description = "Happy World";

           sForce.sObject[] records = new sForce.sObject[]
{
   objAccount
};

           sForce.SaveResult[] saveResults = abc.create(records);
           String newID = saveResults[0].id;
           MessageBox.Show(newID);

note :-sForce.LoginResult lr = abc.login("******", "");.
I have not given my login Id and password .Anybody can put there credencials.


The Error which I am geeting is :-

"The remote server returned an error: (407) Proxy Authentication Required"


I think ,I am  behind a firewall or proxy server for my  internet access.Please provide me with the another way  so that i can hit the Salesforce .


I have tried for evey possibility.Please help me in this regard......???

Regards
Mohit Mohan
SuperfellSuperfell
Talk to your network admin about what credentials to use for your proxy server.