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

IO Error in Invoking external webservice from apex class

i am using apex class like this..follows


global class YodleeLoginService {
webservice static List<object> cobrandLoginContext(string username) {
    List<object> cobrandRespInfo = new List<object>();  
   yintegDomyexpensesCom.CobrandLoginServiceHttpSoap11Endpoint serviceobj=new yintegDomyexpensesCom.CobrandLoginServiceHttpSoap11Endpoint();
    yintegDomyexpensesComXsd.CobrandLoginResponse responseObj=new yintegDomyexpensesComXsd.CobrandLoginResponse();
     responseObj=serviceobj.loginCobrand(cobrandId, appId, cobrandLogin, cobrandPassword);
      String language=responseObj.language;
        return cobrandRespInfo;


/// Here how to return the object from the response or how to get the fileds value present in tne response



I am getting error like this...



  context = (null)
  detail = (null)
  faultcode = "soapenv:Client"
  faultstring = "System.CalloutException: IO Exception: Read timed out

Class.yintegDomyexpensesCom.CobrandLoginServiceHttpSoap11Endpoint.loginCobrand: line 46, column 13
Class.YodleeLoginService.cobrandLoginContext: line 25, column 17
External entry point"


in an Alert box showing the above details .How to solve this ...please


You need to increase your timeout, or get your endpoint to respond faster.


To increase your timeout on a WSDL2Apex generated class (which is what looks like you're using), you set the timeout_x property to the number of milliseconds to wait.


e.g. serviceobj.timeout_x = 60000;


There are some callout limits as well, which you can review here:


I am having this issue, but only when I have the Apex class run as a scheduled job.  When I run the apex through System Log everything works great.  The call that is being made is just a status call to update statuses on a case based on certain criteria.  This issue just started occurring last Thursday and no changes have been made to the application.


Are there issues with scheduling apex through the scheduled jobs?