在EWS SOAP调用中不能设置会议请求属性



我(重新)在Exchange Server中创建(循环)事件,通过纯SOAP调用与Exchange Web Services对话。

当这些事件实际上是会议请求时,我尝试维护先前检索的一些会议属性,因此我将它们放在CreateItem调用中:

AllowNewTimeProposal
AppointmentReplyTime
ConferenceType
IsCancelled
IsOnlineMeeting
IsResponseRequested
MeetingWorkspaceURL
MeetingRequestWasSent
MyResponseType
NetShowURL
Organizer
OptionalAttendees
RequiredAttendees
Resources

起初我得到了错误的Set action is invalid for property属性IsCancelledIsOnlineMeeting,并认为 0,这些可能是自动设置的,但现在我甚至得到了Organizer上的事件,其中用户是组织者。

怎么回事?
所有这些会议属性都不能在CreateItem呼叫中设置吗?
我是否偶然遇到了三个不可设置的—我在哪里可以找到一个实际可设置的列表(例如https://msdn.microsoft.com/en-us/library/aa580675%28v=exchg.80%29.aspx的文档确实提到偶尔的只读元素,但没有这些)?

请求:

<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:SavedItemFolderId>
         <typ:DistinguishedFolderId Id="calendar">
            <typ:Mailbox>
               <typ:EmailAddress>jan@TimeTellBV567.onmicrosoft.com</typ:EmailAddress>
            </typ:Mailbox>
         </typ:DistinguishedFolderId>
      </mes:SavedItemFolderId>
      <mes:Items>
         <typ:CalendarItem>
           <typ:Subject>recuir MODI</typ:Subject>
           <typ:Body BodyType="Text"></typ:Body>
           <typ:Categories>
             <typ:String>TimeTell</typ:String>
           </typ:Categories>
           <typ:ReminderIsSet>false</typ:ReminderIsSet>
           <typ:Start>2015-07-23T11:30:00.000+02:00</typ:Start>
           <typ:End>2015-07-23T12:00:00.000+02:00</typ:End>
           <typ:IsAllDayEvent>false</typ:IsAllDayEvent>
           <typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
           <typ:Location>daar</typ:Location>
           <typ:IsResponseRequested>true</typ:IsResponseRequested>
           <typ:MyResponseType>Organizer</typ:MyResponseType>
           <typ:Organizer>
             <typ:Mailbox>
               <typ:Name>Jan</typ:Name>
               <typ:EmailAddress>jan@somewhere.onmicrosoft.com</typ:EmailAddress>
               <typ:RoutingType>SMTP</typ:RoutingType>
             </typ:Mailbox>
           </typ:Organizer>
           <typ:RequiredAttendees>
             <typ:Attendee>
               <typ:Mailbox>
                 <typ:Name>Ben</typ:Name>
                 <typ:EmailAddress>ben@somewhere.onmicrosoft.com</typ:EmailAddress>
                 <typ:RoutingType>SMTP</typ:RoutingType>
               </typ:Mailbox>
               <typ:ResponseType>Unknown</typ:ResponseType>
             </typ:Attendee>
           </typ:RequiredAttendees>
           <typ:Recurrence>
             <typ:WeeklyRecurrence>
               <typ:Interval>1</typ:Interval>
               <typ:DaysOfWeek>Thursday</typ:DaysOfWeek>
             </typ:WeeklyRecurrence>
             <typ:NoEndRecurrence>
               <typ:StartDate>2015-07-23+01:00</typ:StartDate>
             </typ:NoEndRecurrence>
           </typ:Recurrence>
           <typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
           <typ:ConferenceType>0</typ:ConferenceType>
           <typ:AllowNewTimeProposal>true</typ:AllowNewTimeProposal>
           <typ:IsOnlineMeeting>false</typ:IsOnlineMeeting>
         </typ:CalendarItem>
      </mes:Items>
   </mes:CreateItem>
</soapenv:Body>
</soapenv:Envelope>

反应:

<Envelope>
  <Header>
    <ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="213" MinorBuildNumber="21" Version="V2_47"/>
  </Header>
  <Body>
    <CreateItemResponse>
      <ResponseMessages>
        <CreateItemResponseMessage ResponseClass="Error">
          <MessageText>Set action is invalid for property.</MessageText>
          <ResponseCode>ErrorInvalidPropertySet</ResponseCode>
          <DescriptiveLinkKey>0</DescriptiveLinkKey>
          <MessageXml>
            <FieldURI FieldURI="calendar:Organizer"/>
          </MessageXml>
          <Items/>
        </CreateItemResponseMessage>
      </ResponseMessages>
    </CreateItemResponse>
  </Body>
</Envelope>

我目前正在测试组织者在他自己的日历,反对Office 365,但正如你可以从请求中看到的,我希望这从Exchange2007_SP1起工作。

(自答)

嗯,这个问题有点虚惊,但是我把它留在这里,因为信息很难找到。

事实证明,我试图修改的属性确实都是只读的: IsCancelled, IsOnlineMeeting, MeetingRequestWasSentOrganizer。引用Kim Brand在MS Exchange开发论坛的"Exchange EWS set CalendarItem Organizer"帖子中的回答:

Organizer是一个只读属性,这意味着您不能"设置"该属性。这就是为什么您会看到错误消息"Set action is invalid for property"。
Organizer是负责协调会议出席的一方,其值自动设置为创建CalendarItem的用户(除非使用Delegate Access)。

当我离开上面的属性我的CreateItem调用,它工作。创建/更新约会的GetItem显示Organizer确实设置了:

<t:Organizer>
   <t:Mailbox>
      <t:Name>Jan</t:Name>
      <t:EmailAddress>/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=A9403513C6AA40E68E05776BFEA9C117-JAN</t:EmailAddress>
      <t:RoutingType>EX</t:RoutingType>
      <t:MailboxType>OneOff</t:MailboxType>
   </t:Mailbox>
</t:Organizer>


[编辑添加]:
如果可以通过MAPI设置只读属性,请参阅我的其他帖子
如何设置'只读日历约会属性(与会议相关)?

最新更新