soap - 如何 'set'只读日历约会属性(与 session 相关)?

标签 soap exchangewebservices

我正在同步工具中重新创建日历 session 事件(使用 CreateItem),基本上保留 session 的一些属性并将其写回。

但是,有一些属性是只读的,我认为没有办法保留它们的状态:

  • 正在开会
  • 已取消
  • MeetingRequestWasSent
  • IsOnlineMeeting

其中一些 bool 值存储在属性 AppointmentState 中,但它也是只读的:

Name      Bit      Description

None      0x0000   No flags have been set. This is only used for an appointment that does not include attendees.
Meeting   0x0001   This appointment is a meeting.
Received  0x0002   This appointment has been received.
Canceled  0x0004   This appointment has been canceled.

如果我设置其他 session 属性,例如,IsMeeting 可能会自动设置OptionalAttendees 还是 RequiredAttendees?如果我知道哪些属性触发 IsMeeting 设置,这将对这四个属性之一有所帮助。

(是的,这是 Meeting request properties not settable in EWS SOAP calls? 的后续内容)。

最佳答案

您应该能够使用 MAPI 扩展属性: 预约状态为

Named Prop Name: id: 0x8217=33303 = PidLidAppointmentStateFlags, dispidApptStateFlags
Named Prop Guid: {00062002-0000-0000-C000-000000000046} = PSETID_Appointment

所以 SOAP 应该是这样的

<t:ExtendedProperty>
  <t:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer" />
   <t:Value>1</t:Value>
</t:ExtendedProperty>

(我为此使用托管 API,并从跟踪日志中获取 XML,希望您可以使用它)

[由OP编辑]这是完成这项工作的完整调用:

<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:UpdateItem ConflictResolution="AutoResolve" SendMeetingInvitationsOrCancellations="SendOnlyToChanged">
   <mes:ItemChanges>
      <typ:ItemChange>
         <typ:ItemId <t:ItemId Id="AAMkA[snip]xAAA=" ChangeKey="Dw[snip]Mar"/>
         <typ:Updates>
            <typ:SetItemField>
               <typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
               <typ:CalendarItem>
                  <typ:ExtendedProperty>
                     <typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
                     <typ:Value>5</typ:Value>
                  </typ:ExtendedProperty>
               </typ:CalendarItem>
            </typ:SetItemField>
         </typ:Updates>
      </typ:ItemChange>
   </mes:ItemChanges>
</mes:UpdateItem>
</soapenv:Body>
</soapenv:Envelope>

奇怪的是,结果显示“成功”,但报告了(一个)冲突。我不知道是哪一个:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="225" MinorBuildNumber="19" Version="V2_48" xmlns:h="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>
      <m:UpdateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:UpdateItemResponseMessage ResponseClass="Success">
               <m:ResponseCode>NoError</m:ResponseCode>
               <m:Items>
                  <t:CalendarItem>
                     <t:ItemId Id="AAMk[snip]xAAA=" ChangeKey="DwA[snip]aMat"/>
                  </t:CalendarItem>
               </m:Items>
               <m:ConflictResults>
                  <t:Count>1</t:Count>
               </m:ConflictResults>
            </m:UpdateItemResponseMessage>
         </m:ResponseMessages>
      </m:UpdateItemResponse>
   </s:Body>
</s:Envelope>

关于soap - 如何 'set'只读日历约会属性(与 session 相关)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31678040/

相关文章:

soap - 为什么 Alfresco Moodle 集成会退回我的登录信息?

javascript - SOAP - Google map 和 Javascript - 连接到网络服务

vb.net - 从特定 IP 地址发送 SOAP 请求

c# - EWS - 如何在日期之间搜索项目 [消息]?

c++ - gSoap Exchange Web 服务连接

c# - Webreferences 共享类

java - 如何将 SOAP 响应安全地存储在数据库中?

java - 如何使用 ews 查找附加电子邮件的发件人

java - EWS Java 1.2 - 无法连接到公司 Exchange 服务器

c# - 使用 C# 连接到 Microsoft Exchange Server