Exchange Server 2013 EMail Driver

I have a C# program that connects to my Exchange Server 2010 and is able to read every email.

I am using the microsoft.exchange.webservices.dll library.

The problem is, that this program gives back the following exception on Exchange Server 2013: "The remote server returned an error: (501) Not Implemented."

I have no idea what's the difference between these 2 servers.

Some Code Snippets:

ExchangeVersion version = ExchangeVersion.Exchange2013; ExchangeService service = new ExchangeService(version); service.Credentials = new NetworkCredential("user", "pw", "domain"); service.AutodiscoverUrl("emailaddr");

and here happens the exception:

SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));

FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, sf, new ItemView(20));

service.LoadPropertiesForItems(findResults.Items, PropertySet.FirstClassProperties);

string mailsender = item.LastModifiedName;



  • Edited by Danielb95 Tuesday, May 26, 2015 9:34 AM
  • Moved by jim-xuModerator Wednesday, May 27, 2015 2:26 AM Exchange Development
May 26th, 2015 9:32am

It's the same problem with the EWSEditor.

It shows me all the data of the Exchange Server but when I want to open a message folder, he throws the 501 exception.

Edit: I just noticed, that I can enter the inbox with EWSEditor, it actually shows me the inbox, but the error 501 is still coming.

Edit2: Just tried to create mails in the draft folder. It works. How can this be possible? I can create mails on the server, but I can't read the inbox? (Still get the error though) 

  • Edited by Danielb95 23 hours 26 minutes ago
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2015 6:57am

I think i am close to the solution:

I am already able to display mails from the inbox. The problem is, whenever I use item.Load(), or item.Delete(DeleteMode.HardDelete), the 501 expection still occurs. 

Do you have any ideas?

May 27th, 2015 9:56am

Sounds a bit strange to me all EWS requests are just POST's so there should be no really semantic difference between them. I would use fiddler and capture the traffic and have a close look at the failures that are coming back (eg look at the headers in response to see if they are actually being processed by the Exchange server your request may still be going to wrong server or being affected by something in the network path). The other thing to do is check the IIS log on the Exchange server to see if you can find the 501's and also check the EWS.log on the CAS server.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2015 11:55pm

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

Other recent topics Other recent topics