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
Rajasree JayarajRajasree Jayaraj 

Batch calling Webservice-System.CalloutException: Exceeded maximum time allotted for callout (120000 ms)

I have a batch class which invokes a webservice to validate a VAT ID field. It works well in sandbox, but in Production there are more than 1000+ records which is pulled by this batch (meeting the criteria) and the call does'nt seem to be successful. I see this error in debug log-System.CalloutException: Exceeded maximum time allotted for callout (120000 ms)

I'd given the batch size as 200 but no idea on how to limit the call out time. Also, I am new to web services.
Can somebody give me an idea on how to get over this issue.

Many Thanks in advance!


Ravi Dutt SharmaRavi Dutt Sharma
Hey Sree,

Instead of making a synchronous callout, make an asynchronous callout  and see if that works for you.
Rajasree JayarajRajasree Jayaraj

Thanks Ravi.

Will give a try :)

Rajasree JayarajRajasree Jayaraj
Hey Ravi,

Does this also fix this error-System.CalloutException: IO Exception: Read timed out ?