You need to sign in to do that
Don't have an account?

System.CalloutException: Read timed out ... Is there any way to change the time out period?
I'm frequently getting the error "System.CalloutException: Read timed out" on an HTTP Service (RESTful) call I am making from an Apex class.
It doesn't appear to be a proxy/firewall issue as I *am* able to get a response. I think I just have a slow server on the other end.
Is there any way to increase the timeout period on this call to ensure that the web service has time to respond?
Thanks!
It doesn't appear to be a proxy/firewall issue as I *am* able to get a response. I think I just have a slow server on the other end.
Is there any way to increase the timeout period on this call to ensure that the web service has time to respond?
Thanks!
You may be able to write a retry into your code, so that when you do catch() a timeout you can try one more time.
When the Callout times out, the operation has already been performed on the other end and I'm just waiting for the response. If I make the call again, I will get duplicate transactions. So essentially the call results are lost.
I haven't seen anything in the docs on how to 'commit'. Is there a database method I'm missing? Something like Database.commit() ?
Thanks,
Hi Ron,
Did you find a solution to your dataase.commit() issue?
I am having the same problems.
Thanks,
Phil
Did anyone got an answer to this since I am facing the same issue?
You can use setTimeout to extend timeout duration here is the sample code I ve changed as 20 seconds.
Just a quick clarification on UK1925's post...
The request.setTimeout Integer is milliseconds so calling it with 20 is NOT 20 seconds. You'd want to call it with 20,000:
20 sec * 1000 ms / sec = 20,000 ms
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm
Thats correct...Thanks for @ForceCoder
Setting the timeout to max also doesn't help.
Any other suggestions please?
Thanks!
Are you sure you are able to connect to the server? and the server is sending a response? Did you check the logs at the endpoint server?
Did you find a solution?
To increase the timeout inside of Apex class inside the imported WSDL you can set a property timeout_x to a millisecond value greater than 10 seconds.
Ex:
MySOAPClass stub = MySOAPClass.SalesforceListener();
stub.timeout_x = 60000;
Response_element response = stub.callSoapOperation(parameters);
- John