• CQL
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

I implemented a sample Http callout from an apex class to my server. But it always gives me a "System.CalloutException: Read timed out". I could not find any relevant information while searching on salesforce.

1. How do I confirm that my server is reachable from salesforce? (i believe it is that is why it is throwing a Read timed out exception in place of unreachable destination host or host not found).

2. I am using secure http i.e. https protocol. Are there any specific settings required on salesforce for this?

3. It is a servlet that I am trying to contact. I suppose that would work and I do not necessarily need to expose a web service.

Following is the class I am using. I accessing it as a web service.

global class HttpCalloutSample
{
    webService static String getContent(String url)
    {
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        HttpResponse res = h.send(req);
        return res.getBody();
    }
}


- Pushkar
  • September 05, 2008
  • Like
  • 0