Our external API works perfectly fine when tested on browser. However when called from inside Salesforce controller, it times out.

What could be wrong?

1 Answer 1


There are lot of factors that can cause time outs..

simplest factor is network latency.. if your web service is hosted in your local region, and when you invoke the service from your browser the round trip of request / response is between ur system and web service server which will be shorter

Since the Apex controllers run on salesforce servers, if your salesforce instance is in a different region the round trip of request / response between salesforce and your web service servers will be longer and if its not falling under the default timeout of 10 seconds, it will time out.

you can always configure (increase) the timeout when you make the web service callout from your apex class.

  • I increased the timeout on server and Salesforce and set 'Content-Length' header value to '0' It worked :)
    – pooran
    Sep 9, 2015 at 5:54

You must log in to answer this question.

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