EWS Managed API: Connecting with Office 365-Autodiscover could not be located for a customer who uses hybrid mode (office 365 + OnPrim server)

I have a project that should sync appointments from office 365. The problem is it does not work at the customer's side and gives the message "Autodiscover could not be located". However if I tried the same credentials from my machine, the project works fine. 

I have been suggested to use EWSEditor as a testing tools. And results where the same as follows 

Exception details:
Message: The Autodiscover service couldn't be located.
Type: Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException
Source: Microsoft.Exchange.WebServices
Stack Trace:
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings[TSettings](String emailAddress, List`1 redirectionEmailAddresses, Int32& currentHop)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetLegacyUserSettings[TSettings](String emailAddress)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings(String emailAddress, List`1 requestedSettings)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String emailAddress, ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String emailAddress, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at EWSEditor.Exchange.EwsProxyFactory.DoAutodiscover(EmailAddress emailAddress) in E:\msft tools\ewseditor\EWSEditor\Exchange\EwsProxyFactory.cs:line 35
   at EWSEditor.Exchange.EwsProxyFactory.DoAutodiscover() in E:\msft tools\ewseditor\EWSEditor\Exchange\EwsProxyFactory.cs:line 28
   at EWSEditor.Forms.ServiceDialog.BtnOK_Click(Object sender, EventArgs e) in E:\msft tools\ewseditor\EWSEditor\Forms\Dialogs\ServiceDialog.cs:line 114
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I have also tried to turn off  SCP Lookup option and it gave the same results. 

I think it is worthy to mention that the customers are hybrid mode which is they are using Office 365 and on premises.

I have also modified the code to use Autodiscovery if https://outlook.office365.com/ews/exchange.asmx  did not work .  

In this case it worked but  and managed to start and pass the autodiscovery part, but then it gave me a subscription Error

One or more subscriptions in the request reside on another Client Access server. GetStreamingEvents won't proxy in the event of a batch request.

What should I do ? any suggestions? 

Regards

Ahmad 



January 20th, 2014 5:51pm

Can anyone here suggest me something ?

Regards 

Ahmad.

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2014 8:45am

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

Other recent topics Other recent topics