Meeting request properties not settable in EWS SOA

2019-04-16 20:23发布

I (re)create (recurrent) events in Exchange Server talking to Exchange Web Services with pure SOAP calls.

When these events are actually meeting requests I try to maintain some meeting properties that were previously retrieved, so I put them in the CreateItem call:

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

At first I got the error Set action is invalid for property for the properties IsCancelled and IsOnlineMeeting, and thought O, these are probably set automatically, but now I even get them for the Organizer on the event where the user is the organizer.

What is going on?
Are all these meeting properties not settable in a CreateItem call?
Have I just accidentally bumped into three that are not settable - where can I find a list of what is actually settable (the docs at e.g. https://msdn.microsoft.com/en-us/library/aa580675%28v=exchg.80%29.aspx do mention the occasional read-only element, but not these)?

Request:

<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>

Response:

<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>

I'm currently testing with the organizer in his own calander, against Office 365, but as you can see from the request I want this to work from Exchange2007_SP1 up.

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-04-16 20:44

(Answering my own question)

Mmm, that question was a bit of a false alarm, but I'm leaving it here because the information is hard to find.

It turns out that the properties I attempted to modify were indeed all read-only: IsCancelled, IsOnlineMeeting, MeetingRequestWasSent and Organizer. Quoting Kim Brand from an answer in the 'Exchange EWS set CalendarItem Organizer' post at the MS Exchange Development Forum:

Organizer is a read-only property, which means that you can't "set" that property. That's why you are seeing the error message "Set action is invalid for property".
Organizer is the party responsible for coordinating meeting attendence, and its value gets automatically set to the user that creates the CalendarItem (unless Delegate Access is used).

When I leave the above properties out of my CreateItem call, it works. A GetItem on the created/updated appointment shows that Organizer is indeed set:

<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>


[Edited to add]:
It is possible to set readonly properties through MAPI, see my other post
How to 'set' read-only calendar appointment properties (related to meetings)?

查看更多
登录 后发表回答