function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jorge Ortega TraversoJorge Ortega Traverso 

Webservice Callout Exception: IO Exception: Read timed out

Hi all,

I've import a WSDL into my Org creating a client classes for my web service.

I'm getting read timeout when invoking this callout with some load (about 4Kb of data included as parameter).

When I invoke the callout with a minimun load (about 1,5Kb) the callout is responding ok, obviously, we cannot reduce call the callouts, because this occurs with outbound messages which are sent to our ESB

I've create a case, and the Salesforce Support guy tells me this
You can increase polling time with below patterns for SOAP and REST based callouts
================================================================
For REST based

req.setTimeout(120000); // timeout in milliseconds - this is two minute

Use the above for increasing HTTP callout time to poll for response

request inita=new request.ManageCollectionHttpPort();
inita.timeout_x=120000;

use above pattern for increasing time out in WSDL API.This is a sample stub class assumed .You will need to figure out your stub class and add timeout__x to same


I'm looking into my Stub class and I cannot find any way to include the line 
request initia = new request.ManageCollectionHttpPort();

May be the support guy only wants me to include the timeout line, anyway, I tried the callout setting the timeout_x property of my stub class to 120K milliseconds and got the same result... IO Exception: Read timed out.

Is ther anyone who solved this issue or explained it because a firewall problem?
Best Answer chosen by Jorge Ortega Traverso
Jorge Ortega TraversoJorge Ortega Traverso
Answering my own question.

All read timed out problems came from a firewal blocking communications which use more than one MTU, when the callout payload is above 1500 bytes and it requires more than one MTU, this firewall is droping the second and next packages, making the read timed out on every previous network item.

The workaround was to adjust the first network item, a BigIP F5, to forward traffic using 1300 bytes MTU, because none is able to modify the firewall config, which is adding more communications problems on other project sides.

Well, I hope none face this problem, because this was really hard to diagnose and almost nobody believed that the MTU size could affect on this way.

Regards.