none
Microsoft Exchange Web Service - The response received from the service didn't contain valid XML. RRS feed

  • Question

  • Hello
    I have a program С# which is reading inbox email from outlook 2010
    the following errors periodically occurs:
    Error: The response received from the service didn't contain valid XML.
    Error read outlook: The response received from the service didn't contain valid XML.
    Error exchage: The response received from the service didn't contain valid XML. url-https://outlook.domain.com/EWS/Exchange.asmx
    Url server Exchange https://outlook.domain.com/EWS/Exchange.asmx

    I'm using library Microsoft Exchange Web Service
    Mailbox and login are in different domains
    An error occurs when I can not open the page https://mail.mydomain.com/ews/exchange.asmx

    my algorithm:
    1. search for mailbox address in connection string url-https://outlook.omega.sbrf.ru/EWS/Exchange.asmx
    2. domain search to mailbox address
    3. reading letters in a mailbox

    part of the code of my program:
    using Microsoft.Exchange.WebServices.Data;
                ExchangeService service = new ExchangeService();

                try
                {
                    string url = Properties.Settings.Default.ExchangeUrl;

                    service.UseDefaultCredentials = true;

                    try
                    {
                        service.Url = new Uri(url);
                        PropertySet propSetTest = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.Body);
                        Folder inboxTest = Folder.Bind(service, WellKnownFolderName.Inbox);
                    }
                    catch (Exception e)
                    {
                        Log($"Error exchage: {e.Message} url-{url}", true);
                        UserPrincipal userP = UserPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain), Environment.UserName);
                        Log(string.Format($"Find {userP.EmailAddress} Url Exchange."), true);

                        Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRedirectionUrlValidationCallback RedirectionUrlValidationCallback = null;

                        service.AutodiscoverUrl(userP.EmailAddress, RedirectionUrlValidationCallback);
                        Log(string.Format($"Url Exchange {service.Url.AbsoluteUri}"), true);
                    }

                    PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.Body);

                    Folder inbox = Folder.Bind(service, WellKnownFolderName.Inbox);




    How to fix it?
    • Edited by Aleks Roth Sunday, November 12, 2017 11:10 AM 1
    Sunday, November 12, 2017 8:02 AM