+ Start a Discussion
srikanth123srikanth123 

System.CalloutException: IO Exception: Read timed out

Hi All,

 

I developed a web service and hosted over the web. I used the wsdl of this webservice to create an apex class in salesforce. I created a visual force page which will consume this apex class. So finally what i'm trying to do is access the webservice from vf page. But while doing this i'm getting the following error "System.CalloutException: IO Exception: Read timed out". I want to know the different reasons why this error occurs. Can anyone please help.

Best Answer chosen by Admin (Salesforce Developers) 
srikanth123srikanth123

Hi All,

 

Finally after a week's hard work i found that the IP addresses were not whitelisted properly on the web server. Whitelisting the IP addresses solved my problem. The IP range list is as follows

 

204.14.232.0/25 East Coast Data Center (set one) 
204.14.233.0/25 East Coast Data Center (set two) 
204.14.234.0/25 West Coast Data Center (set one) 
204.14.235.0/25 West Coast Data Center (set two)

202.129.242.0/25 Singapore Data Center

 

To clarify, the “0/25″ that you see in the ranges refers to an abbreviated form of Classless Inter-domain routing notation. In essence this notation is a network number followed by a “/” and a number , the latter number indicates the number of 1′s (starting a the left most bit i.e MSB – most significant bit) in the subnet mask i.e the number of bits relevant to a network portion of the IP address. So “/25″ means 25 bits constitute the subnet mask of 255.255.255.128, and really 25 bits reserved for network address which is identified by performing bitwise “AND” to the full network number.

For example 204.14.232.0/25 means 2 possible networks in the form of 204.14.232.0 and 204.14.232.128 each having possible 126 hosts i.e total 252 hosts or IP addresses per specified range.

All Answers

Sonali BhardwajSonali Bhardwaj

The basic reason behind this is your web service is not responding with in a time period.

Try increasing time out value. Set it to its maximum.

srikanth123srikanth123

my web service returns me the result with in 1 or 2 seconds. However i've tried increasing the timeout to max but i'm still getting the same error. any more ideas?

DodiDodi

You may have a authentication issue...Can you access your service from SOAP UI or another external web service test tool....if you can, copy the request message from SOAP UI into your code to see if the issue persists. If it works in SOAP UI and not in the Force.com IDE, then there may be something in your code....try testing externally, if that does not work...paste your code and exact error message and I will take a look.

 

Regards

srikanth123srikanth123

My web service is very simple it takes a "Long" datatype value as input and irrespective of the input the webservice returns an object with 4 string datatype values. Here is the debug log...

14:26:01.059|METHOD_ENTRY|[69]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
14:26:01.064|CALLOUT_REQUEST|[69]|<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header /><env:Body><getConsignmentDetails xmlns="http://tempuri.org/"><conId>500012357412</conId></getConsignmentDetails></env:Body></env:Envelope>
14:26:01.065|CALLOUT_REQUEST|[69]|mywebservice.getConsignmentDetails_element request_x::SFDC_STACK_DEPTH=1 SOAPAction="http://tempuri.org/getConsignmentDetails" User-Agent=SFDC-Callout/21.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8 
14:26:11.067|EXCEPTION_THROWN|[69]|System.CalloutException: IO Exception: Read timed out
14:26:11.067|METHOD_EXIT|[69]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
14:26:11.068|METHOD_EXIT|[14]|mywebservice.Service1Soap.getConsignmentDetails(Long)
14:26:11.068|CODE_UNIT_FINISHED|webservicesample invoke(conDetails)

 

and here is the code...

 

 

//consignment details - BEGIN
    public String ConId{get;set;}
    public String CON_ID{get;set;}
    public String CON_DELETE_IN{get;set;}
    public String CCC_ID{get;set;}
    public String CON_REPLIC_VER_NR{get;set;}
    public String CON_ADD_TD{get;set;}
    public pageReference conDetails()
    {
        mywebservice.Service1Soap ss = new mywebservice.Service1Soap();        
        system.debug(ConId);
        mywebservice.consignment con = ss.getConsignmentDetails(long.valueOf(ConId));
        CON_ID = con.CON_ID;
        CON_DELETE_IN = con.CON_DELETE_IN;
        CCC_ID = con.CCC_ID;
        CON_REPLIC_VER_NR = con.CON_REPLIC_VER_NR;
        CON_ADD_TD = con.CON_ADD_TD;
        return null;
    }

 

 

DodiDodi

Does not look like you are getting a respone from the web service at all either due to failed security authtication or bad request.....take a look in the security details of your request....

 

Also, can you successfully execute against the service from an external tool such as SOAP UI? There is a plugin for the IDE and a stand alone app you can use to test the service....from there, you can copy and paste the equest to replicate the transaction.

srikanth123srikanth123

Hi All,

 

Finally after a week's hard work i found that the IP addresses were not whitelisted properly on the web server. Whitelisting the IP addresses solved my problem. The IP range list is as follows

 

204.14.232.0/25 East Coast Data Center (set one) 
204.14.233.0/25 East Coast Data Center (set two) 
204.14.234.0/25 West Coast Data Center (set one) 
204.14.235.0/25 West Coast Data Center (set two)

202.129.242.0/25 Singapore Data Center

 

To clarify, the “0/25″ that you see in the ranges refers to an abbreviated form of Classless Inter-domain routing notation. In essence this notation is a network number followed by a “/” and a number , the latter number indicates the number of 1′s (starting a the left most bit i.e MSB – most significant bit) in the subnet mask i.e the number of bits relevant to a network portion of the IP address. So “/25″ means 25 bits constitute the subnet mask of 255.255.255.128, and really 25 bits reserved for network address which is identified by performing bitwise “AND” to the full network number.

For example 204.14.232.0/25 means 2 possible networks in the form of 204.14.232.0 and 204.14.232.128 each having possible 126 hosts i.e total 252 hosts or IP addresses per specified range.

This was selected as the best answer
XrosXros

Hi srikanth123,

I have the same problem as you had, but seems like I don't understand your solution :(
Maybe that's becouse I'm newbie in salesforce and there are many enigmatic things for me :)
Could you please explain this solution more deeply for me? What exactly should I do and where?

 

You can find my branch with problem here:

http://boards.developerforce.com/t5/Apex-Code-Development/quot-We-are-down-for-maintenance-quot-during-Web-Service-s/m-p/341371#M60487

 

Thanks and Regards,
Roman

DevishreeDevishree

Hi Srikanth,

 

         I also getting the same System.CalloutException:ReadTimedOut Exception. Can you tell me how to do IP white listing? I want the clarity also. You're IP's are blocked by force.com or You're Server blocking force.com IP's.

 

Any help would be Appreciated.

 

 

Thanks In Advance,

DeviShree

gbu.varungbu.varun

Hi,

 

I am getting same error. How can I whitelist my ip address. I have add my ip in Remote Access list, but it does not work.

 

 

 

Thanks,

Varun

gbu.varungbu.varun

Hi,

 

I was also facing such type of error. I have solved it myself. 

System.CalloutException can occurs due ti many reasons.

I was facing this problem beacue I was using private ip address to access my salesforce service. We can access only public web services by salesforce using username and password.

 

Thanks,

Varun

 

FrankCabrejaFrankCabreja

srikanth123,

 

Where did you you whitelist these salesforce ip address? Somewhere in the Docusign Web interface? Please help.

 

Thanks.

Shannon DykesShannon Dykes
Not sure if you guys got an answer to how to whitelist IPs in Salesforce, so here you go:

To whitelist your IP address for a new location, follow the steps below: (Note that you must be a Salesforce system administrator to perform these steps)

1. Log in to Salesforce.com
2. Navigate to setup by clicking on your name> setup
3. Click Security Controls>Network Access>New