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
MriduMridu 

Getting a ReadTime out exception when I try to call webservice

Class:public with sharing class MTRFWSHelperSD{
 
public MTRFSoftwareDownloadWS.GetDownloadsRssMTRResult_element sdresult=null;
     MTRFProdInfoWrapperSD  infowrap=new MTRFProdInfoWrapperSD();
     public void getValue(){
     
     
    MTRFSoftwareDownloadWS.RosServiceSoap rssmtrresult=new MTRFSoftwareDownloadWS.RosServiceSoap();
   system.debug('am here');
    rssmtrresult.timeout_x =60000;
   
    rssmtrresult.GetDownloadsRssMTR(1979,5);
    
   
     system.debug('am Done');
   
     }}

 

 

Webservice:

public class MTRFSoftwareDownloadWS {
    
    public class GetRosIds_element {
        public Integer pazId;
        private String[] pazId_type_info = new String[]{'pazId','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'pazId'};
    }
    public class GetDownloadsRssResult_element {
   
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class GetDownloadsRssResponse_element {
        public MTRFSoftwareDownloadWS.GetDownloadsRssResult_element GetDownloadsRssResult;
        private String[] GetDownloadsRssResult_type_info = new String[]{'GetDownloadsRssResult','http://tempuri.org/','GetDownloadsRssResult_element','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'GetDownloadsRssResult'};
    }
    public class GetDownloadsRss_element {
        public Integer pazId;
        public Integer maxItems;
        private String[] pazId_type_info = new String[]{'pazId','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] maxItems_type_info = new String[]{'maxItems','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'pazId','maxItems'};
    }
    public class GetDownloadsRssMTRResult_element {
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class GetRosIdsResponse_element {
        public String GetRosIdsResult;
        private String[] GetRosIdsResult_type_info = new String[]{'GetRosIdsResult','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'GetRosIdsResult'};
    }
    public class RosServiceSoap {
        public String endpoint_x = 'http://cu-staging.customers.thomsonreuters.com:8088/Dev/ProductSupport/rosService.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        
        private String[] ns_map_type_info = new String[]{'http://tempuri.org/', 'MTRFSoftwareDownloadWS'};
        public String GetRosIds(Integer pazId) {
            MTRFSoftwareDownloadWS.GetRosIds_element request_x = new MTRFSoftwareDownloadWS.GetRosIds_element();
            MTRFSoftwareDownloadWS.GetRosIdsResponse_element response_x;
            request_x.pazId = pazId;
            Map<String, MTRFSoftwareDownloadWS.GetRosIdsResponse_element> response_map_x = new Map<String, MTRFSoftwareDownloadWS.GetRosIdsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/GetRosIds',
              'http://tempuri.org/',
              'GetRosIds',
              'http://tempuri.org/',
              'GetRosIdsResponse',
              'MTRFSoftwareDownloadWS.GetRosIdsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetRosIdsResult;
        }
        public MTRFSoftwareDownloadWS.GetDownloadsRssMTRResult_element GetDownloadsRssMTR(Integer pazId,Integer maxItems) {
           system.debug('Inside GetDownloadsRssMTR');
            MTRFSoftwareDownloadWS.GetDownloadsRssMTR_element request_x = new MTRFSoftwareDownloadWS.GetDownloadsRssMTR_element();
            MTRFSoftwareDownloadWS.GetDownloadsRssMTRResponse_element response_x;
            request_x.pazId = pazId;
            request_x.maxItems = maxItems;
            Map<String, MTRFSoftwareDownloadWS.GetDownloadsRssMTRResponse_element> response_map_x = new Map<String, MTRFSoftwareDownloadWS.GetDownloadsRssMTRResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(  //Here it shows this exception
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/GetDownloadsRssMTR',
              'http://tempuri.org/',
              'GetDownloadsRssMTR',
              'http://tempuri.org/',
              'GetDownloadsRssMTRResponse',
              'MTRFSoftwareDownloadWS.GetDownloadsRssMTRResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetDownloadsRssMTRResult;
        }
        public MTRFSoftwareDownloadWS.GetDownloadsRssResult_element GetDownloadsRss(Integer pazId,Integer maxItems) {
            MTRFSoftwareDownloadWS.GetDownloadsRss_element request_x = new MTRFSoftwareDownloadWS.GetDownloadsRss_element();
            MTRFSoftwareDownloadWS.GetDownloadsRssResponse_element response_x;
            request_x.pazId = pazId;
            request_x.maxItems = maxItems;
            Map<String, MTRFSoftwareDownloadWS.GetDownloadsRssResponse_element> response_map_x = new Map<String, MTRFSoftwareDownloadWS.GetDownloadsRssResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/GetDownloadsRss',
              'http://tempuri.org/',
              'GetDownloadsRss',
              'http://tempuri.org/',
              'GetDownloadsRssResponse',
              'MTRFSoftwareDownloadWS.GetDownloadsRssResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetDownloadsRssResult;
        }
    }
    public class GetDownloadsRssMTR_element {
        public Integer pazId;
        public Integer maxItems;
        private String[] pazId_type_info = new String[]{'pazId','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] maxItems_type_info = new String[]{'maxItems','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'pazId','maxItems'};
    }
    public class GetDownloadsRssMTRResponse_element {
        public MTRFSoftwareDownloadWS.GetDownloadsRssMTRResult_element GetDownloadsRssMTRResult;
        private String[] GetDownloadsRssMTRResult_type_info = new String[]{'GetDownloadsRssMTRResult','http://tempuri.org/','GetDownloadsRssMTRResult_element','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'GetDownloadsRssMTRResult'};
    }
}

 

System.CalloutException: IO Exception: Read timed out
Class.MTRFSoftwareDownloadWS.RosServiceSoap.GetDownloadsRssMTR: line 79, column 1 Class.MTRFWSHelperSD.getValue: line 12, column 1

 

 

Please help me on this..

_Prasu__Prasu_

Maximum timeout setting for the callout is 120seconds, if response is not recieved in 120 seconds it will throw the exception. You can find more information at http://wiki.developerforce.com/page/Apex_Web_Services_and_Callouts