Как "установить" свойства календаря только для чтения (связанные с собраниями)?

Я воссоздаю события календарного собрания в инструменте синхронизации (использую CreateItem), в основном сохраняя некоторые свойства для встреч и записывая их обратно.

Однако есть некоторые свойства, доступные только для чтения, и я не вижу способа сохранить их состояние:

  • IsMeeting
  • IsCancelled
  • MeetingRequestWasSent
  • IsOnlineMeeting

Некоторые из этих логических значений хранятся в свойстве 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.

Является IsMeeting может быть автоматически установлен, если я установлю другие свойства встречи, например, например OptionalAttendees или же RequiredAttendees? Это помогло бы с одним из четырех, если бы я знал, какие свойства вызывают настройку IsMeeting,

(Да, это продолжение свойств запроса на собрание, которые нельзя установить в вызовах EWS SOAP?).

1 ответ

Решение

Вы должны иметь возможность использовать расширенные свойства MAPI: состояние назначения

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

Так что мыло, которое должно быть что-то вроде

<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>
Другие вопросы по тегам