Folder.Bind hangs for long time then throws exception

Hi,

I have an issue that I'm struggling to understand and hope somebody can point me in the right direction.

The actual situation is quite complex (due to the development environment and requirement to support multiple transport systems) but ultimately the front-end "Inbox" application is calling a back-end .NET DLL that uses Exchange Web Services Managed API 2.0.

When calling the Folder.Bind() method, the application hangs. I thought it was freezing completely but after leaving it for 10 minutes or so it eventually throws an exception saying "Not enough quota is available to process this command".

I never had this issue until I started trying to support 'push notifications' by using the StreamingSubscription StreamingSubscriptionConnection classes, so these definitely have something to do with it. And seems to only occur after I have added and removed a folder from the StreamingSubscriptionConnection (even though the folder it freezes on is not one I've previously 'touched'...I think).


July 15th, 2015 10:09am

Hi RJP,

the error you receive is saying that your user is consuming more resources on the Exchange than that Exchange is allowing (The user being the Exchange Mailbox used for the connection). Either you are somehow spamming the Exchange or your quotas are fairly restrictive.

The reason it happens with this call specifically is probably because it's the only synchroneous one (others will be failing, too).

So ... debug time. Find out how you are performing too many service requests against the Exchange (Removing the limitations will probably be problematic for your Exchange Performance. Better solve the root problem.).

Cheers,
Fred

Free Windows Admin Tool Kit Click here and download it now
July 15th, 2015 10:37am

I tried running Fiddler to check for this. Strangely, with Fiddler running, the effect is slightly different. Now it hangs on the call to StreamingSubscriptionConnection.Open() for a few minutes before coming back with a ServiceRequestException saying "Additional information: The request failed. The operation has timed out".

Edit:

I didn't see any excessive requests indicating spamming of Exchange. The last request indicated in Fiddler was:

POST https://outlook.office365.com/EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-ClientStatistics: MessageId=72b98b6e-a535-42c7-989f-dd27fa96008e,ResponseTime=826,SoapAction=SubscribeToStreamingNotifications;
Authorization: Basic <REDACTED>
Host: outlook.office365.com
Cookie: ClientId=3W3BUMDFR0CINTLYTCUAVQ; exchangecookie=8da9f05d2bd4450985946d25b4d01098
Content-Length: 778
Expect: 100-continue

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1" />
  </soap:Header>
  <soap:Body>
    <m:GetStreamingEvents>
      <m:SubscriptionIds>
        <t:SubscriptionId>JgBhbTNwcjA1bWI0MzUuZXVycHJkMDUucHJvZC5vdXRsb29rLmNvbRAAAADDWlkBGAkARrPUahuJmyX9eDnbZiiN0ggQAAAAQMPZAfrBCkG1Ro9PcrM+yg==</t:SubscriptionId>
      </m:SubscriptionIds>
      <m:ConnectionTimeout>30</m:ConnectionTimeout>
    </m:GetStreamingEvents>
  </soap:Body>
</soap:Envelope>

  • Edited by RJP1973 15 hours 51 minutes ago
July 15th, 2015 11:31am

Think I may have answered my own question (well, thanks to https://ewsstreaming.codeplex.com/).

I needed to add the following line at the start of my app:

 ServicePointManager.DefaultConnectionLimit = 255;

Seems to be working now. Touch wood :)

  • Marked as answer by RJP1973 15 hours 39 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2015 11:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics