Note: First of all, sorry for my poor level of English.
I'm having trouble with all the requests to EWS (using managed api) in the environment of a client when I use to create the ExchangeService the timezone Utc (new ExchangeService (ExchangeVersion.Exchange2007_SP1, TimeZoneInfo.Utc);)
The returned error is: ResposeCode = ErrorTimeZone (A time zone with the specified ID could not be found.)
Any idea?
Here you have the log traces an EWS request that returns this error:
18 2014-05-19 13:52:33,224 6 TRACE XXXX SCService.exe (null) (null)[EwsResponseHttpHeaders] <Trace Tag="EwsResponseHttpHeaders" Tid="6" Time="2014-05-19 13:52:33Z">
HTTP/1.1 500 Internal Server Error
Content-Length: 1014
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Mon, 19 May 2014 13:52:35 GMT
Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
</Trace>
(null)
19 2014-05-19 13:52:33,224 6 TRACE XXXX SCService.exe (null) (null)[EwsResponse] <Trace Tag="EwsResponse" Tid="6" Time="2014-05-19 13:52:33Z" Version="15.00.0516.014">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="3" MajorBuildNumber="298" MinorBuildNumber="1" Version="Exchange2007_SP1" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>A time zone with the specified ID could not be found.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorTimeZone</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">A time zone with the specified ID could not be found.</e:Message>
<t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:Value Name="Id">UTC</t:Value>
</t:MessageXml>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
</Trace>
Thanks for reading :)
The problem was that for some reason none of the exchange CAS in the production environment of the client had the UTC time zone defined in your windows registry.
I was able to access the owa of the client and saw that I couldn't set the UTC time zone in the owa settings. This convinced them to check if the UTC time zone had properly set in one of their CAS. And as it was not, I asked for set manually de utc time zone in the windows registry. Then I configured my application for attack only to this CAS, and all worked well.
Researching the client told me that everything was caused by a patch of exchange they had recently applied and they had already identified and tested in their environment of pre-production another patch that fixed it.