2015-07-21 80 views
1

我在Exchange Server中使用純SOAP調用與Exchange Web Services交談(重新)創建(經常性)事件。在EWS SOAP調用中無法設置會議請求屬性?

當這些事件實際上是會議要求我儘量保持先前獲取的一些會議屬性,所以我把它們放在CreateItem電話:

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

起初,我得到了錯誤Set action is invalid for property的性質IsCancelledIsOnlineMeeting,並認爲O,這些可能自動設置爲,但現在我甚至可以在用戶是組織者的事件中獲得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>[email protected]</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>[email protected]</typ:EmailAddress> 
       <typ:RoutingType>SMTP</typ:RoutingType> 
      </typ:Mailbox> 
      </typ:Organizer> 
      <typ:RequiredAttendees> 
      <typ:Attendee> 
       <typ:Mailbox> 
       <typ:Name>Ben</typ:Name> 
       <typ:EmailAddress>[email protected]</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起工。

回答

1

(回答我的問題)

嗯,這個問題有點虛驚一場,但我離開這裏,因爲信息是很難找到的。

事實證明,屬性我試圖確係所有隻讀修改:IsCancelledIsOnlineMeetingMeetingRequestWasSentOrganizer。 從在MS Exchange開發論壇the 'Exchange EWS set CalendarItem Organizer' post答案引述金品牌:

組織者是一個只讀屬性,這意味着你不能「設置」該屬性。這就是爲什麼你看到錯誤消息「設置操作對屬性無效」。
組織者是負責協調會議關注的一方,其值會自動設置爲創建CalendarItem的用戶(除非使用委託訪問)。

當我離開我的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來設置只讀屬性,看到我的其他職位
How to 'set' read-only calendar appointment properties (related to meetings)?

+0

使用純SOAP請求的EWS程序員似乎是一個垂死的品種:)了不起的信息Jan! – Tholle

+1

@Tholle這是必須從Delphi(XE2)完成所有這些工作的結果,其中我從來沒有得到WDSL導入代碼的工作。 –