You need to sign in to do that
Don't have an account?
Jayaguru
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.
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.
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
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
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
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
How to do it for soap service.