locked
EWS FindItems stopped working... reasons?! RRS feed

  • Question

  • Hi all

    I've been using the Web Services API from within a SharePoint 2010 timer job. All has been working for the last few months with no issue. I recently noticed that something had broken. No code had changed but something was broken. After some debugging, my FindItems isn't returning the same data. I was doing 

     

    FindItemResults<Item> findresults;
    findResults = exService.FindItems(WellKnownFolderName.Inbox, new ItemView(10));
    
    // then process each item in the results
    foreach (Item item in findResults.Items)
    {
    string itemSubject = item.Subject;
    // etc.
    }
    

    This worked fine for ages, but now, when I check the value of itemSubject - it's null or empty. It doesn't seem to be a specific email that's causing this error. I've also tried loading the item with the FirstClassProperties, but that doesn't work either. Is there something going on that I'm not familiar with?

     


    Tuesday, July 26, 2011 6:04 PM

Answers

  • Hi, thanks... I actually figured it out (within 5 seconds of posting...) Code blindness.... the problem was staring me in the face - the Subject line WAS empty... I couldn't see it because obviously EWS does some kind of lazy load on the items... so I thought it was failing on a particular message, whereas it was another one further down the queue.

    Tuesday, July 26, 2011 6:23 PM

All replies

  • Hi,

    please enable tracing on the ExchangeService class and check the data that is sent and received by the ExchangeService instance.

    Kind regards,
    Henning

    "weirdbeardmt" wrote in message news:f6dd8296-1f4e-4b9f-84bc-65840865d192@communitybridge.codeplex.com...

    Hi all

    I've been using the Web Services API from within a SharePoint 2010 timer job. All has been working for the last few months with no issue. I recently noticed that something had broken. No code had changed but something was broken. After some debugging, my FindItems isn't returning the same data. I was doing

    FindItemResults<Item> findresults;
    findResults = exService.FindItems(WellKnownFolderName.Inbox, new
    ItemView(10));
    
    // then process each item in the results
    foreach (Item item in findResults.Items)
    {
    string itemSubject = item.Subject;
    // etc.
    }
    

    This worked fine for ages, but now, when I check the value of itemSubject - it's null or empty. It doesn't seem to be a specific email that's causing this error. I've also tried loading the item with the FirstClassProperties, but that doesn't work either. Is there something going on that I'm not familiar with?

    Tuesday, July 26, 2011 6:18 PM
  • Hi, thanks... I actually figured it out (within 5 seconds of posting...) Code blindness.... the problem was staring me in the face - the Subject line WAS empty... I couldn't see it because obviously EWS does some kind of lazy load on the items... so I thought it was failing on a particular message, whereas it was another one further down the queue.

    Tuesday, July 26, 2011 6:23 PM