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
JayaguruJayaguru 

ESOAPHTTPException with message - A connection with the server could not be established

I am creating a connection to salesforce from Delphi. I am able to login to salesforce and get issue details.
After this I created a windows service to do the same process. By using windows service,I am able to login to salesforce. But I am not query any objects. I get the exception "ESOAPHTTPException with message - A connection with the server could not be established"

  RIO := THTTPRIO.Create(nil);
  xConnection := getSOAP(false, '', RIO);
  lr := xConnection.login('Username', 'pwd');
  RIO.Service    := lr.sessionId;
  RIO.URL        := lr.serverUrl;
  sh := SessionHeader.Create;
  sh.sessionId := lr.sessionId;
  (RIO as ISOAPHeaders).Send(sh); 
    qr := xConnection.query('Select id,Name,LastName from User');

At this place I get the exception.
Please suggest how to proceed.
BDatlaBDatla
Hi JayaGuru,

Please check the target server url after login and use that for accesing any other soap call.
Can you please check the target server Url ?

Regards,
BDatla

 
BDatlaBDatla

Hi JayaGuru,

Can you please tell me the http  status code ?
You can find more information in the below article.
https://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_login.htm

Reagrds,
BDatla
JayaguruJayaguru
Hi BDatla
Sorry for the late reply as I had trouble in logging in to salesforce.
I get the Server URL:'https://cs17.salesforce.com/services/Soap/c/33.0/00Dg0000006Rx5b/0DFg00000008PbN'
Pls tell me how to get the status code in salesforce
BDatlaBDatla
Hi Jayaguru,

You can get the status code from the http response .
Please check the below link :
http://www.example-code.com/delphi/http_getStatus.asp

Regards,
BDatla
JayaguruJayaguru
In the link u mentioned above http status code for a normal webservice.
How to do it for soap service.
 
JayaguruJayaguru
Is anyone available to provide solution