2011-10-28 16 views
0

Exchangeとタイムゾーンが私の死になるでしょう。Exchange Webサービスで、別のタイムゾーンで終日Apptを作成する

私のExchange Serverは、EST(UTC -5)にあります。 Exchangeのバージョンは2007 SP1です。ユーザーはパリのフランス(UTC +2)にあります。終日イベントとしてアポイントメントを作成しようとすると、それは常に2日間にわたります。

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Header> 
     <ns2:MailboxCulture xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      >en-US</ns2:MailboxCulture> 
     <ns2:RequestServerVersion 
      xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      Version="Exchange2007_SP1"/> 
     <ns2:TimeZoneContext xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> 
      <ns2:TimeZoneDefinition Id="Romance Standard Time"/> 
     </ns2:TimeZoneContext> 
    </soap:Header> 
    <soap:Body> 
     <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      SendMeetingInvitations="SendToAllAndSaveCopy"> 
      <SavedItemFolderId> 
       <ns2:DistinguishedFolderId Id="calendar"/> 
      </SavedItemFolderId> 
      <Items> 
       <ns2:CalendarItem> 
        <ns2:Subject>Test TZ</ns2:Subject> 
        <ns2:Body BodyType="Text"/> 
        <ns2:Start>2011-10-28T09:00:00Z</ns2:Start> 
        <ns2:End>2011-10-28T17:00:00Z</ns2:End> 
        <ns2:IsAllDayEvent>true</ns2:IsAllDayEvent> 
        <ns2:Location>Somewhere</ns2:Location> 
       </ns2:CalendarItem> 
      </Items> 
     </CreateItem> 
    </soap:Body> 
</soap:Envelope> 

注:ここでは要求され、私はに設定私のコンピュータ上でタイムゾーンを持っている「(UTCは+ 01:00)ブリュッセル、コペンハーゲン、マドリッド、パリ」コンピュータが物理的にESTに位置しているが、。

これはOutlookが表示するもので、2日間に及ぶものです。 What Outlook displays

私は取引所から新しく作成された予定表のアイテムを取得した場合、それは以下の開始日と終了日/時刻を示しています

<t:Start>2011-10-28T00:00:00Z</t:Start> 
<t:End>2011-10-29T00:00:00Z</t:End> 
<t:IsAllDayEvent>true</t:IsAllDayEvent> 

Entire response can be found here

私はの様々な組み合わせを試してみました開始日と終了日は、私が何をしていても、私はいつも2日間に及んでいます。 ESTで同じこと(tzコンテキストヘッダーなし)を実行すると、1日だけになります。

答えて

2

ここで自分の質問に答える。キーが会議の時間帯を設定しているように見えます。

<ns2:MeetingTimeZone> 
    <ns2:BaseOffset>-P0Y0M0DT2H0M0S</ns2:BaseOffset> 
</ns2:MeetingTimeZone> 

これはUTC +2であり、期間値は正の値でなければならないため、「 - 」を「P」に付けてください。 TZは "UTC +2"なので、UTCを得るには2を引きます(したがって、オフセットで負の値になります)。これがEST(UTC -5)の場合、BaseOffsetはP0Y0M0DT5H0M0Sになります。

これは誰かを助けることを望みます。

完全な要求は、次のようになります

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Header> 
     <ns2:MailboxCulture xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      >en-US</ns2:MailboxCulture> 
     <ns2:RequestServerVersion 
      xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      Version="Exchange2007_SP1"/> 
     <ns2:TimeZoneContext xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> 
      <ns2:TimeZoneDefinition Id="Romance Standard Time"/> 
     </ns2:TimeZoneContext> 
    </soap:Header> 
    <soap:Body> 
     <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" 
      xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" 
      SendMeetingInvitations="SendToAllAndSaveCopy"> 
      <SavedItemFolderId> 
       <ns2:DistinguishedFolderId Id="calendar"/> 
      </SavedItemFolderId> 
      <Items> 
       <ns2:CalendarItem> 
        <ns2:Subject>Test TZ</ns2:Subject> 
        <ns2:Body BodyType="Text"/> 
        <ns2:Start>2011-10-27T22:00:00Z</ns2:Start> 
        <ns2:End>2011-10-28T22:00:00Z</ns2:End> 
        <ns2:IsAllDayEvent>true</ns2:IsAllDayEvent> 
        <ns2:Location>Somewhere</ns2:Location> 
        <ns2:MeetingTimeZone> 
         <ns2:BaseOffset>-P0Y0M0DT2H0M0S</ns2:BaseOffset> 
        </ns2:MeetingTimeZone> 
       </ns2:CalendarItem> 
      </Items> 
     </CreateItem> 
    </soap:Body> 
</soap:Envelope> 
+0

は、Java EWSのクライアントを使用すると、私はSendInvitationsMode http://stackoverflow.com/a/20864321/448641を変更しなければならなかった類似のケースを見ました – vinnyjames

関連する問題