locked
EWS request failed .The underlying connection was closed: An unexpected error occurred on a receive. RRS feed

  • Question

  • Hi,

    We met an issue invoke the EWS on user's device suddenly, it worked well at last month.
    Could you help to give us some advice for us to investigate?

    The Exception as below:

    The request failed .The underlying connection was closed: An unexpected error occurred on a receive.

    Here list the relevant info about the client package.

    Framework Version: .NET Framework 4.0

    Microsoft.Exchange.WebServices Version: v2.0.50727

    Microsoft.Exchange.WebServices.Auth Version: v4.0.30319

    Source codes as below:

    ExchangeService service=new ExchangeService(ExchangeVersion.Exchange2013);
    
    service.UserDefaultCredentials=true;
    
    service.Url=https://XXXX/ews/exchange.asmx
    
    string email address = System.DirectoryServices.AccountManagerment.UserPrincipal.Current.EmailAddress;
    
    service.AutodiscoverUrl(emailaddress);
    FolderId folderid=new FolderId(WellKnownFolderName.Inox);
    List<SearchFilter> searchFilterCollection=new List<SearchFilter>();
    searchFilterCollection.Add(new SearchFilter,IsGreaterThan(ItemSchema.DateReceived,DateTime.Now.AddDays(-30)));
    searchFilterCollection.Add(new SearchFilter.IsEqualTo(ItemSchema.ItemClass,"IPM.Note"));
    SearchFilter searchFilter= new SerarchFileter.SerarchFilterCollection(LogicalOperator.And,searchFilterCollection.ToArrary());)
    var itemView=new ItemView(30,0,OffsetBasePoint.Beginning);
    FindItemsResults<Item> userItems=service.FindItems(folderId,serarchFilter,itemview);

    Monday, November 30, 2020 6:41 AM

Answers