通过EWS更新日历事件后Outlook中显示的时区不正确
我在更新约会时遇到时区问题 步骤1,创建单个事件,效果良好 首先,我创建一个事件,从当地时间10:00到11:00(阿姆斯特丹DST,所以UTC+2)。通过EWS更新日历事件后Outlook中显示的时区不正确,outlook,timezone,exchange-server,exchangewebservices,outlook-2007,Outlook,Timezone,Exchange Server,Exchangewebservices,Outlook 2007,我在更新约会时遇到时区问题 步骤1,创建单个事件,效果良好 首先,我创建一个事件,从当地时间10:00到11:00(阿姆斯特丹DST,所以UTC+2)。 我的Exchange server 2010(SP2)知道“西欧标准时区”。 没有问题,以下是Outlook 2007中的事件: 这是创建事件的XML: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="h
我的Exchange server 2010(SP2)知道“西欧标准时区”。
没有问题,以下是Outlook 2007中的事件: 这是创建事件的XML:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<soapenv:Header>
<typ:RequestServerVersion Version="Exchange2007_SP1"/>
<typ:MailboxCulture>en-US</typ:MailboxCulture>
<typ:TimeZoneContext>
<typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
</typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
<mes:CreateItem SendMeetingInvitations="SendToNone">
<mes:SavedItemFolderId>
<typ:DistinguishedFolderId Id="calendar">
<typ:Mailbox>
<typ:EmailAddress>developer@timetellbv.nl</typ:EmailAddress>
</typ:Mailbox>
</typ:DistinguishedFolderId>
</mes:SavedItemFolderId>
<mes:Items>
<typ:CalendarItem>
<typ:Subject>New event 10:00-11:00</typ:Subject>
<typ:Body BodyType="Text"></typ:Body>
<typ:Categories>
<typ:String>TimeTell</typ:String>
</typ:Categories>
<typ:ReminderIsSet>false</typ:ReminderIsSet>
<typ:Start>2014-08-19T10:00:00.000+02:00</typ:Start>
<typ:End>2014-08-19T11:00:00.000+02:00</typ:End>
<typ:IsAllDayEvent>false</typ:IsAllDayEvent>
<typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
<typ:Location></typ:Location>
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
</typ:CalendarItem>
</mes:Items>
</mes:CreateItem>
</soapenv:Body>
</soapenv:Envelope>
恩美
developer@timetellbv.nl
新事件10:00-11:00
计时器
假的
2014-08-19T10:00:00.000+02:00
2014-08-19T11:00:00.000+02:00
假的
忙吗?
请注意,我指定了Meeting时区,并为Start/Finish指定了一个明确的时区,以便Exchange Server知道如何将其转换为UTC,而不必依赖服务器时区(请参阅)。我尝试在创建事件时忽略所有时区信息,但这立即给了我第2步的“雷克雅未克效应”。不管怎样,第一步很好 步骤2,更新单个事件,失败:更改Outlook中显示的时区 现在我只修改事件标题;我需要再次指定所有项目(我的代码不知道更改了什么):
恩美
新事件10:00-11:00(修改)
正常的
计时器
假的
假的
2014-08-19T10:00:00.000+02:00
2014-08-19T11:00:00.000+02:00
忙吗?
10722
2014-08-19T16:22:22.094+02:00
80000
00000000 82ADE26393957649AD9C74BF97109BC2070084A6175871FF 6A40850535554066620A0000000000210000084A6175871FF 6A40850535554066620A00023CB438330000
但现在我明白了:事件在日历概述中正确显示 但当我打开它时,我突然得到了错误的“雷克雅未克”时间: 注意,UpdateItem调用的头仍然具有
<typ:TimeZoneContext>
<typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
</typ:TimeZoneContext>
但是没有
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
在调用中,就像在CreateItem调用中一样
如果我尝试像这样将其放入,我会得到一个错误“在存储中找不到指定的对象”:
2014-08-19T10:00:00.000+02:00
2014-08-19T11:00:00.000+02:00
我曾尝试将MeetingTimeZone放置在文件中的其他位置,但不断出现语法错误
将TimeZoneContext保留在UpdateItem的标题之外并不能解决这个问题(根据我在中的理解,我应该使用它)
为了向后兼容Exchange Server 2007 SP1,我需要使用MeetingTimeZone(对于更高版本,MeetingTimeZone已被弃用,我们应该使用StartImeZone/EndTimeZone)
问题:如何更改UpdateItem调用以确保Outlook事件保持正确的时间(区域)?
背景资料:
- Exchange服务器版本返回:
- 本地Outlook设置为阿姆斯特丹时区(由于DST,当前为UTC+2)
- 但没有解决办法
- 我明白了!多亏了这篇文章
事实上,你不能只插入一个
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
行,但您还必须将MeetingTimeZone指定为要更改的CalendarItem元素
因此,必须在通话中插入此附加项:
<typ:SetItemField>
<typ:FieldURI FieldURI="calendar:MeetingTimeZone"/>
<typ:CalendarItem>
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time" />
</typ:CalendarItem>
</typ:SetItemField>
并确保将其放置在正确的位置,因为必须按照中定义的顺序指定项目
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
<typ:SetItemField>
<typ:FieldURI FieldURI="calendar:MeetingTimeZone"/>
<typ:CalendarItem>
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time" />
</typ:CalendarItem>
</typ:SetItemField>