+ Start a Discussion
EE 

Integration error - cannot connect to host

We are using the Salesforce API with PHP to connect using the WSDL downloaded from the Salesforce instance and an error is received that it could not connect to host test.salesforce.com. This is not a login failure, as that would get a different error and we can run this same code from a different network and gain access.

The error seems to be that enterprise.soap.sforce.com does not have a DNS entry that it can resolve to find the host IP. Are there any modifications we can make to the WSDL or the environment to allow our system to successfully find enterprise.soap.sforce.com? We know this isn't a firewall issue and we know this works from a network that can successfully resolve the enterprise.soap.sforce.com address.

Given that, I'd say we're looking for what could be changed to allow this to function given the lack of DNS resolution. Could we replace the reference to enterprise.soap.sforce.com with an IP address in the WSDL or add an entry to the HOSTS file?
Best Answer chosen by E
VinayVinay (Salesforce Developers) 
Hi,

Can you check if you need to connect to production instance.

Review below links and snippet which can help you.

https://developer.salesforce.com/forums/?id=906F0000000B0LKIA0
https://stackoverflow.com/questions/36868510/soapclient-could-not-connect-to-host-exception-with-one-wsdl-api
https://salesforce.stackexchange.com/questions/107122/salesforce-php-api-invalid-login

Thanks,
Vinay Kumar