重复活动的开始日期是休息一天?

时间:2014-01-14 13:26:32

标签: exchange-server exchangewebservices

下面的代码块1创建一个定期事件,每天重复,开始日期 3。可能 2014年 代码块2:响应OK
代码块3:要求首次出现该ID(Exchange开始计数为1,而不是0) 代码块4:响应:第一次出现在 4。可能 ?????这里发生了什么(以及如何解决)?

创建活动:

<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:Items>
         <typ:CalendarItem>
           <typ:Subject>Random master event 24 for emp id 20652</typ:Subject>
           <typ:Body BodyType="Text">TEST recurring event</typ:Body>
           <typ:Categories>
             <typ:String>TimeTell</typ:String>
           </typ:Categories>
           <typ:ReminderIsSet>false</typ:ReminderIsSet>
           <typ:Start>2014-05-03T13:24:00.000+01:00</typ:Start>
           <typ:End>2014-05-03T17:25:00.000+01:00</typ:End>
           <typ:IsAllDayEvent>false</typ:IsAllDayEvent>
           <typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
           <typ:Location>Here</typ:Location>
           <typ:Recurrence>
             <typ:DailyRecurrence>
               <typ:Interval>1</typ:Interval>
             </typ:DailyRecurrence>
             <typ:NumberedRecurrence>
               <typ:StartDate>2014-05-03Z</typ:StartDate>
               <typ:NumberOfOccurrences>27</typ:NumberOfOccurrences>
             </typ:NumberedRecurrence>
           </typ:Recurrence>
           <typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
         </typ:CalendarItem>
      </mes:Items>
   </mes:CreateItem>
</soapenv:Body>
</soapenv:Envelope>

响应:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="516" MinorBuildNumber="29" Version="Exchange2013" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:CreateItemResponseMessage ResponseClass="Success">
               <m:ResponseCode>NoError</m:ResponseCode>
               <m:Items>
                  <t:CalendarItem>
                     <t:ItemId Id="AAMkAG[snip]Kf/fBAAA=" ChangeKey="DwAAABYAAAC4CIO9P6hbQ7Rh7x62oA4/AACKhInU"/>
                  </t:CalendarItem>
               </m:Items>
            </m:CreateItemResponseMessage>
         </m:ResponseMessages>
      </m:CreateItemResponse>
   </s:Body>
</s:Envelope>

查找事件1:

<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:GetItem>
   <mes:ItemShape>
      <typ:BaseShape>IdOnly</typ:BaseShape>
      <typ:AdditionalProperties>
         <typ:FieldURI FieldURI="calendar:Start" />
      </typ:AdditionalProperties>
   </mes:ItemShape>
   <mes:ItemIds>
      <typ:OccurrenceItemId RecurringMasterId="AAMkAG[snip]Kf/fBAAA=" InstanceIndex="1"/>
   </mes:ItemIds>
</mes:GetItem>
</soapenv:Body>
</soapenv:Envelope>

响应:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="516" MinorBuildNumber="29" Version="Exchange2013" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:GetItemResponseMessage ResponseClass="Success">
               <m:ResponseCode>NoError</m:ResponseCode>
               <m:Items>
                  <t:CalendarItem>
                     <t:ItemId Id="AAMkAGFkYTBkM2UxLTkyYTctNDA1NC05MGY3LWJkMzQ4MWQwNjAyMQFRAAgI0TVC7TkAAEYAAAAAhhvKZmdnRkCUOsqdWWjc9wcAuAiDvT+oW0O0Ye8etqAOPwAAAAAADwAAuAiDvT+oW0O0Ye8etqAOPwAAin/3wQAAEA==" ChangeKey="DwAAABYAAAC4CIO9P6hbQ7Rh7x62oA4/AACKhInU"/>
                     <t:Start>2014-05-04T12:24:00Z</t:Start>
                  </t:CalendarItem>
               </m:Items>
            </m:GetItemResponseMessage>
         </m:ResponseMessages>
      </m:GetItemResponse>
   </s:Body>
</s:Envelope>

这是通过SOAPUI与Exchange 2013 Exchange 2010

进行对话来完成的

这是一个Outlook屏幕截图,确认从5月4日开始:

enter image description here

附加测试: - 使用NoEndRecurrence或EndDateRecurrence创建也失败:

<typ:NoEndRecurrence>
  <typ:StartDate>2014-05-03Z</typ:StartDate>
</typ:NoEndRecurrence>

<typ:EndDateRecurrence>
  <typ:StartDate>2014-05-03Z</typ:StartDate>
  <typ:EndDate>2014-06-03Z</typ:EndDate>
</typ:EndDateRecurrence>

1 个答案:

答案 0 :(得分:1)

您的创建调用是在dd-mm-yyyZ中创建事件,该事件处于Zulu时间(a.k.a. UTC)。如果你实际上处于不同的时区,那么你可以在任何一个方向上将你的事件扭曲一天。

EWS和时区(一般来说是时区)可能非常令人困惑。使用托管EWS库连接到EWS时,您可以指定所在的时区,这样,当您提供任何日期时,您不必经常记住这一点。

还要记住某些时区在不同的日期开始/结束夏令时(或根本没有夏令时(亚利桑那州))。 This can even move certain appointments by 1 hour in a short timewindow each year