2

I am calling Salesforce SOAP API from C#. There are multiple instances of the .NET process running which results in concurrent SOAP API calls being made to Salesforce.

Some of the calls are failing with error - System.Net.WebException The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

I have observed that this error occurs only during the peak times when large number of SOAP API calls are being made.

I am using proxy class generated using old "Add Web Reference" method in C# instead WCF way of "Add Service Reference". So there is no explicit binding configuration that I am using for my C# proxy class.

any idea why this error might be happening ?

1

There is a Concurrent API Request Limit. Can you track how many calls are being made simultaneously when the error occurs and how long they were running for? If it is this limit you are exceeding you could implement some form of queuing to throttle the requests.

Concurrent API Request Limits

The following table lists the limits for various types of organizations for concurrent requests (calls) with a duration of 20 seconds or longer.

Organization Type           Limit
Developer Edition           5
Trial organizations         5
Production organizations    25
Sandbox                     25
| improve this answer | |
  • I never have received explicit LIMIT_EXCEEDED error in this case so I assume that this is not because of any type of limit error. Is my assumption correct ? Also, We were not able to reproduce this error in sandbox. – apn Aug 31 '14 at 15:13
  • I'm not sure how this limit manifests itself. I haven't actually encountered it yet, even if a fairly large system with many simultaneous API calls occurring. How long are your API calls going for before encountering this WebException? – Daniel Ballinger Aug 31 '14 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.