【问题标题】:Bi-weekly calendar appointment created through EWS showing up weird通过 EWS 创建的双周日历约会显示很奇怪
【发布时间】:2023-04-10 10:52:01
【问题描述】:

我在 Exchange 中创建双周日历约会时遇到问题在 Outlook 中查看它

活动从 2013 年 1 月 19 日开始,每周六和周日每两周一次(间隔 = 2),最多发生 5 次。
预期发生:1 月 19 日星期六、1 月 20 日星期日、2 月 2 日星期六、2 月 3 日星期日、2 月 16 日星期六
观察到的事件:1 月 19 日星期六、1 月 27 日星期日、2 月 2 日星期六、2 月 10 日星期日,2 月 16 日坐什么??
我查看了 Outlook 2003 SP3 或 Outlook 2010 (SP?) 的约会。

这是使用 Exchange Web 服务创建事件的代码,以及关于我尝试过的事情的 cmets:

<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 makes no difference -->
  <typ:TimeZoneContext>
     <typ:TimeZoneDefinition Id="W. Europe Standard Time"></typ:TimeZoneDefinition>
  </typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
   <mes:CreateItem SendMeetingInvitations="SendToNone">
      <mes:Items>
         <typ:CalendarItem>
           <typ:Subject>Every 2 weeks sa/su, ends after 5</typ:Subject>
           <typ:Body BodyType="Text"></typ:Body>
           <typ:ReminderIsSet>false</typ:ReminderIsSet>
           <typ:Start>2013-01-19T11:00:00.000+01:00</typ:Start>
           <typ:End>2013-01-19T11:30:00.000+01:00</typ:End>
           <typ:IsAllDayEvent>false</typ:IsAllDayEvent>
           <typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
           <typ:Location></typ:Location>
           <typ:Recurrence>
           <typ:WeeklyRecurrence>
             <typ:Interval>2</typ:Interval>
             <!-- Day name order makes no difference -->
             <typ:DaysOfWeek>Saturday Sunday</typ:DaysOfWeek>
             <!-- typ:FirstDayOfWeek>Sunday</typ:FirstDayOfWeek   Tried but not allowed in Exchange2007_SP1 or Exchange2010-->
           </typ:WeeklyRecurrence>
           <typ:NumberedRecurrence>
             <typ:StartDate>2013-01-19</typ:StartDate>
             <typ:NumberOfOccurrences>5</typ:NumberOfOccurrences>
           </typ:NumberedRecurrence>
         <!-- MeetingTimeZone makes no difference -->
         <typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
         </typ:Recurrence>
         </typ:CalendarItem>
      </mes:Items>
   </mes:CreateItem>
</soapenv:Body>
</soapenv:Envelope>

此代码实际上与 David Sterling 等人的书 Inside Microsoft Exchange Server 2007 Web Services 的清单 9-29 相同

如果我在 EWS 中查询此事件,我会取回我创建的内容:

<t:CalendarItem>
   <t:ItemId Id="AQMkA[snip]PYb1"/>
   <t:Subject>Every 2 weeks sa/su, ends after 5</t:Subject>
   [snip]
   <t:Start>2013-01-19T10:00:00Z</t:Start>
   <t:End>2013-01-19T10:30:00Z</t:End>
   <t:CalendarItemType>RecurringMaster</t:CalendarItemType>
   <t:Recurrence>
      <t:WeeklyRecurrence>
         <t:Interval>2</t:Interval>
         <t:DaysOfWeek>Sunday Saturday</t:DaysOfWeek>
      </t:WeeklyRecurrence>
      <t:NumberedRecurrence>
         <t:StartDate>2013-01-19+01:00</t:StartDate>
         <t:NumberOfOccurrences>5</t:NumberOfOccurrences>
      </t:NumberedRecurrence>
   </t:Recurrence>
</t:CalendarItem>

这是没有服务包的 Exchange server 2010。
我尝试过的其他事情:

1) 如果我在 Outlook 中编辑该神秘事件并告诉它在星期五发生,它或多或少会正确更新:一个星期五额外发生(2 月 1 日),最后一个 2 月 16 日星期六事件消失,但是我的交替的星期六/太阳事件仍然存在

2) 我在 EWS 中使用相同的代码创建了这个事件:
周二周四(1 月 15 日开始):很好
星期日星期二(开始日期 1 月 15 日):错误(再次交替模式)
周一周六(1月14日开始):很好

3) 在 Outlook 2003 中创建完全相同的事件,而不是通过 EWS。它显示得很好。然后查询 EWS,我得到完全相同的 SOAP 结果。

我担心的是:
我误解了重复参数还是所有 Outlook 版本都错了?后者似乎不太可能,但上面指出了这一点。

有人知道这里可能出了什么问题吗?

【问题讨论】:

    标签: outlook exchange-server exchangewebservices


    【解决方案1】:

    我刚刚发现这是一周的第一天问题。

    我的 Outlook 将星期一设置为一周的第一天。 如果我在 Outlook 中创建双周周六日约会,则出现的情况与预期一致:

     m  t  w  t  f  s  s
     .  .  .  .  . 19 20
     .  .  .  .  .  .  .
     .  .  .  .  .  2  3
     .  .  .  .  .  .  .
     .  .  .  .  .  9  .
    

    现在我将 Outlook 设置为将星期日作为一周的第一天。然后我得到:

     s  m  t  w  t  f  s 
     .  .  .  .  .  . 19
     .  .  .  .  .  .  .
    27  .  .  .  .  .  2
     .  .  .  .  .  .  .
    10  .  .  .  .  . 16
     .  .  .  .  .  .  .
    

    这里的“推理”是:
    - 本周有一个周六/太阳出现的机会:1 月 19 日
    - 跳两周
    - 分配该周的下一个周六/周日
    - 等等

    通过 SOAP 创建我的约会时,Exchange 服务器假定星期天是一周的开始,并从第二个示例创建事件。 但是当在 Outlook 中以星期一作为一周的开始显示时,我们得到:

     m  t  w  t  f  s  s
     .  .  .  .  . 19  .
     .  .  .  .  .  . 27
     .  .  .  .  .  2  .
     .  .  .  .  .  . 10
     .  .  .  .  . 16  .
    

    所以我要做的“全部”就是告诉 EWS,我将在星期一作为一周的第一天进行预约。
    It cannot be set in the WeeklyRecurrence node
    看起来好像可以通过用户配置读取和设置。
    这就引出了下一个问题:How can I read the entire calendar user configuration in Exchange Web Services?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-01
      • 2017-02-16
      • 2013-01-26
      • 1970-01-01
      相关资源
      最近更新 更多