问题描述
使用Exchange 2010 Web服务(EWS)创建全天活动约会时遇到麻烦.
I got in trouble with creation of an all day event appointment using Exchange 2010 Web Services (EWS) .
根据创建全天事件约会对象的现有要求,必须指定指定的开始时间和结束时间(即2011年10月20日12:00:00 AM)以及时区.
According to existing requirements to create an All day event appointment object needs to have specified start and end time (i.e. 10/20/2011 12:00:00 AM), and also timezone.
但是我的应用程序转换为使用EWS而不是WebDAV时,会将开始时间和结束时间设置为GMT(格林威治时间),然后将其发送到Exchange服务器.
But my application converted to use EWS instead of WebDAV sets start and end time converted to GMT (Greenwich) time which then sent to Exchange server.
这种技术与WebDAV完美配合.但是使用EWS,我得到的结果很奇怪:约会跨越3(三)天,而且不是全天活动约会!!!
Such technique worked perfectly with WebDAV.But with EWS I get weird result: appointment spans on 3 (three) days, and is NOT All day event appointment !!!
我的邮箱时区设置为太平洋标准时间"(使用OWA界面),而Exchange服务器的日期和时间"也设置为太平洋标准时间".
My mailbox timezone set to Pacific Standard Time (using OWA interface), and Exchange server Date and Time also set to Pacific Standard time.
将约会的开始和结束时间分别设置为"2011-10-20T07:00:00.000Z"和"2011-10-21T07:00:00.000Z".就当地时间而言,这些时间分别为"10/20/2011 12:00:00 AM"和"10/21/2011 12:00:00 AM"(考虑夏令时).
Appointment start and end times are set to "2011-10-20T07:00:00.000Z" and "2011-10-21T07:00:00.000Z" respectively.In terms of local time these times are "10/20/2011 12:00:00 AM" and "10/21/2011 12:00:00 AM" respectively (considering Daylight Saving time).
如果约会对象的IsAllDayEvent属性设置为False –约会创建正确–不是全天,则从10/20/2011 12AM开始,到10/21/2011 12AM结束,仅占用一天– 10月/20/2011在Outlook日历中.
If IsAllDayEvent property of appointment object set to False – appointment created correctly – not as All day, starts at 10/20/2011 12AM and ends at 10/21/2011 12AM, and occupies only one day – October /20/2011 in Outlook Calendar.
但是,如果约会对象的isAllDayEvent属性设置为True(其余所有内容保持不变)–约会从2011年10月19日9:00:00 PM开始,在2011年10月21日9:00:00 PM结束,并且是不是整天.
But If isAllDayEvent property of appointment object set to True (everything rest remains the same) – appointment starts at Oct/19/2011 9:00:00PM, ends at Oct/21/2011 9:00:00PM, and is NOT All day.
可能是我做错了事,但基于上述问题,我为自己提出了以下问题:
It might be that I’m doing something wrong, but based on described above following question raised for me:
- EWS是否支持格林威治时间全天活动?
如果是,我的错误是什么?
- does EWS support Greenwich Time for All day events?
If yes – what might be my mistakes?
我很感谢任何建议.真挚地安德鲁
I appreciate any suggestion.SincerelyAndrew
推荐答案
遇到了一个类似的问题,即我的全天活动是从前一天的下午4点创建到全天活动的指定日期的下午4点(我目前是在太平洋标准时间-8中,因此在交换服务器端似乎是UTC错误.
Ran into a similar problem where my all day event was being created from 4pm the previous day to 4pm the specified date of the all day event (I'm currently in pacific standard time -8 so appears to be a UTC bug on the exchange server side).
调用Appointment.save
时,使用可选的第二个参数SendInvitationsMode.SendToNone
,例如:
When calling Appointment.save
, use the optional second parameter, SendInvitationsMode.SendToNone
, e.g.:
a.save(new FolderId(WellKnownFolderName.Calendar),
SendInvitationsMode.SendToNone);
如果您更喜欢XML,请参阅Envelope/Body/CreateItem/@ SendMeetingInvitations:
If you prefer XML see Envelope/Body/CreateItem/@SendMeetingInvitations:
<?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:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007"></t:RequestServerVersion>
</soap:Header>
<soap:Body>
<m:CreateItem SendMeetingInvitations="SendToNone">
<m:SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar"></t:DistinguishedFolderId>
</m:SavedItemFolderId>
<m:Items>
<t:CalendarItem>
<t:Subject>From Java EWS</t:Subject>
<t:Body BodyType="HTML">the body</t:Body>
<t:Start>2014-01-03T00:00:00Z</t:Start>
<t:End>2014-01-04T00:00:00Z</t:End>
<t:IsAllDayEvent>true</t:IsAllDayEvent>
</t:CalendarItem>
</m:Items>
</m:CreateItem>
</soap:Body>
</soap:Envelope>
这篇关于Exchange 2010 Web服务-创建全天活动约会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!