Activity Forums Salesforce® Discussions What is the default timeout period while calling webservice from Apex in salesforce?

  • Radhakrishna

    Member
    April 24, 2017 at 8:57 am

    Hello Saurabh,

    The following limits and limitations apply when Apex code makes a callout to an HTTP request or a web services call. The web services call can be a SOAP API call or any external web services call.

    A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call.
    The default timeout is 10 seconds. A custom timeout can be defined for each callout. The minimum is 1 millisecond and the maximum is 120,000 milliseconds. See the examples in the next section for how to set custom timeouts for Web services or HTTP callouts.
    The maximum cumulative timeout for callouts by a single Apex transaction is 120 seconds. This time is additive across all callouts invoked by the Apex transaction.
    You can’t make a callout when there are pending operations in the same transaction. Things that result in pending operations are DML statements, asynchronous Apex (such as future methods and batch Apex jobs), scheduled Apex, or sending email. You can make callouts before performing these types of operations.
    Pending operations can occur before mock callouts in the same transaction. See Performing DML Operations and Mock Callouts for WSDL-based callouts or Performing DML Operations and Mock Callouts for HTTP callouts.
    When the header Expect: 100-Continue is added to a callout request, a timeout occurs if a HTTP/1.1 100 Continue response isn’t returned by the external server.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos