I am trying to access a webservice hosted on localhost from salesforce with the following url: "localhost:8080/HttpCalloutSalesforce/list"

But it's not working and I am getting the below error message :

ERROR: The requested URL could not be retrieved


The requested URL could not be retrieved

While trying to process the request: GET /HttpCalloutSalesforce/list?id=0019000000L9MNVAA3 HTTP/1.0 Accept-Language: en-US,en;q=0.8 SFDC_STACK_DEPTH: 1 Accept-Encoding: gzip,deflate,sdch User-Agent: SFDC-Callout/28.0 Content-Type: text/plain; charset=utf-8 Host: Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Via: 1.1 proxy-tyo.net.salesforce.com:8080 (squid) X-Forwarded-For: Cache-Control: max-age=259200 Connection: keep-alive

Can anyone please confirm whether salesforce support Http Callout from localhost or not ?

  • If you've developed a webservice running on Tomcat and you are trying to call it from Salesforce... is the Tomcat instance running on your local machine? Open up a port and call it by IP address rather than as localhost.
    – Doug B
    Sep 25, 2013 at 8:03
  • @DougB did you mean a LAN IP or a public internet IP?
    – Bforce
    Jun 24, 2014 at 16:30

1 Answer 1


No, you can't do callouts to localhost. Salesforce is hosted in the cloud and has no knowledge of your local network. You need to provide a public url for Salesforce to hit.

  • so, Is there any online free web-service hosting server where I can host my webservice and test callout ?
    – S.Sharma
    Sep 25, 2013 at 6:18
  • You'll either need to use a sandbox setup for the service you're using, or you could fake it quite quickly and easily using Heroku and Node.js.
    – Matt Lacey
    Sep 25, 2013 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .