Open pheenomenon opened 8 years ago
possible ref. #475? start investigation with the suggested tools.
@serious6 Thank you for your reply. Unfortunately #475 does not help. I was using WebCredentials(user, pass); earlier, even with WebCredentials(user, pass, domain); I get the same error.
ews-editor does the same stuff what my code does. I see the below XML response for DoAutodiscover but TestExchangeService fails.
016-01-13T16:22:53|EwsTrace|DoAutodiscover|AutodiscoverResponse|
<Trace Tag="AutodiscoverResponse" Tid="1" Time="2016-01-14 00:22:53Z" Version="15.00.0913.015">
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettingsResponse</a:Action>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/2010/Autodiscover" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<h:MajorVersion>15</h:MajorVersion>
<h:MinorVersion>0</h:MinorVersion>
<h:MajorBuildNumber>1104</h:MajorBuildNumber>
<h:MinorBuildNumber>0</h:MinorBuildNumber>
<h:Version>Exchange2013_SP1</h:Version>
</h:ServerVersionInfo>
</s:Header>
<s:Body>
<GetUserSettingsResponseMessage xmlns="http://schemas.microsoft.com/exchange/2010/Autodiscover">
<Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>NoError</ErrorCode>
<ErrorMessage />
<UserResponses>
<UserResponse>
<ErrorCode>NoError</ErrorCode>
<ErrorMessage>No error.</ErrorMessage>
<RedirectTarget i:nil="true" />
<UserSettingErrors />
<UserSettings>
<UserSetting i:type="StringSetting">
<Name>InternalEwsUrl</Name>
<Value>https://dummy.domainowa.com/EWS/Exchange.asmx</Value>
</UserSetting>
<UserSetting i:type="StringSetting">
<Name>ExternalEwsUrl</Name>
<Value>https://dummy.domainowa.com/EWS/Exchange.asmx</Value>
</UserSetting>
</UserSettings>
</UserResponse>
</UserResponses>
</Response>
</GetUserSettingsResponseMessage>
</s:Body>
</s:Envelope>
</Trace>
2016-01-13T16:22:53|EwsTrace|TestExchangeService|EwsRequestHttpHeaders|
<Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2016-01-14 00:22:53Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: EwsEditor (ExchangeServicesClient/15.00.0913.015)
Accept-Encoding: gzip,deflate
</Trace>
2016-01-13T16:22:53|EwsTrace|TestExchangeService|EwsRequest|
<Trace Tag="EwsRequest" Tid="1" Time="2016-01-14 00:22:53Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:ConvertId DestinationFormat="HexEntryId">
<m:SourceIds>
<t:AlternateId Format="HexEntryId" Id="00" Mailbox="blah@blah.com" />
</m:SourceIds>
</m:ConvertId>
</soap:Body>
</soap:Envelope>
</Trace>
2016-01-13T16:22:53|EwsTrace|TestExchangeService|EwsResponseHttpHeaders|
<Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2016-01-14 00:22:53Z">
HTTP/1.1 403 Forbidden ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator. )
Connection: close
Pragma: no-cache
Content-Length: 2040
Cache-Control: no-cache
Content-Type: text/html
</Trace>
2016-01-13T16:22:53|Error|Application_ThreadException|Unhandled exception!|
Exception details:
Message: The request failed. The remote server returned an error: (403) Forbidden.
Type: Microsoft.Exchange.WebServices.Data.ServiceRequestException
Source: Microsoft.Exchange.WebServices
Stack Trace:
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalConvertIds(IEnumerable`1 ids, IdFormat destinationFormat, ServiceErrorHandling errorHandling)
at Microsoft.Exchange.WebServices.Data.ExchangeService.ConvertIds(IEnumerable`1 ids, IdFormat destinationFormat)
at EWSEditor.Common.Extensions.ExchangeServiceExtensions.TestExchangeService(ExchangeService service) in e:\msft tools\ewseditor\EWSEditor\Common\Extensions\ExchangeServiceExtensions.cs:line 171
at EWSEditor.Forms.ServiceDialog.BtnOK_Click(Object sender, EventArgs e) in e:\msft tools\ewseditor\EWSEditor\Forms\Dialogs\ServiceDialog.cs:line 148
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.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.OnMessage(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)
Exception details:
Message: The remote server returned an error: (403) Forbidden.
Type: System.Net.WebException
Source: System
Stack Trace:
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
Hello experts,
We are using EWS to connect to an exchange. The same code works for a particular exchange server but while ran against another exchange server it passes autodiscover but fails with other operation like findAppointments()
Below is the error log with trace enabled. Any pointers on what settings at 2nd exchange is coming in the way ? For privacy reasons I have anonymized the below trace.