none
Error when updating occurrence with EWS Managed API 1.2 RRS feed

  • Question

  • Hi All,

    When I'm trying to update occurrence I get following error:

    "StartTimeZone required when setting the Start, End, IsAllDayEvent, or Recurrence properties.  You must load or assign this property before attempting to update the appointment."

    My code:

    Appointment occurrence = Appointment.BindToOccurrence(Service.ConnectToService(credentials), appointment.Id.ToExchangeItemId(), 2);
                occurrence.Subject = "Urgent Status Update!!!";
                occurrence.End = occurrence.End.AddHours(1);
                occurrence.Update(ConflictResolutionMode.AlwaysOverwrite);

    When I set StartTimeZone I get another error: "Set action is invalid for property."

    Appointment occurrence = Appointment.BindToOccurrence(Service.ConnectToService(credentials), appointment.Id.ToExchangeItemId(), 2);
                occurrence.Subject = "Urgent Status Update!!!";
                occurrence.End = occurrence.End.AddHours(1);
                occurrence.StartTimeZone = TimeZoneInfo.Utc;
                occurrence.Update(ConflictResolutionMode.AlwaysOverwrite);

    What I need to do to update occurrence correctly?

    Friday, September 7, 2012 11:29 AM

All replies

  • Any help?
    Monday, September 10, 2012 6:50 AM
  • Anyone?
    Monday, September 10, 2012 2:57 PM
  • What version of Exchange are you using ? What your doing should work okay (given a fully patched server) how where the appointments created ?

    As a starting point i would enable tracing and have a look what's being sent back to the server http://msdn.microsoft.com/en-us/library/exchange/dd633676(v=exchg.80).aspx .

    Cheers
    Glen

    Tuesday, September 11, 2012 6:59 AM
  • I'm using Exchange Server 2007 SP1. Get-ExchangeServer shows me version 8.1 (build 240.6). Recurring appointment was created with Managed EWS API 1.2

    From EWS trace. When I'm trying to set timezone to UTC while updating occurrence:

    EWS Request:

    <Trace Tag="EwsRequest" Tid="8" Time="2012-09-11 08:15:13Z" Version="14.03.0067.001">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2007_SP1" />
          <t:TimeZoneContext>
            <t:TimeZoneDefinition Id="GTB Standard Time" />
          </t:TimeZoneContext>
        </soap:Header>
        <soap:Body>
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite" SendMeetingInvitationsOrCancellations="SendToAllAndSaveCopy">
            <m:ItemChanges>
              <t:ItemChange>
                <t:ItemId Id="AAMkAGEyNDQ3NDM1LWQyMzMtNDIwMC05OTMyLTYzNzM2ZmMyOTJjMgFRAAiIz2JtwFCwAEYAAAAAFx5LO/P6yk6B0I0aI9A/6AcAJKDWynD6nkS/GrqN3XRzeQAXvLp1dgAAJKDWynD6nkS/GrqN3XRzeQE7UOzJDwAAEA==" ChangeKey="DwAAABYAAAAkoNbKcPqeRL8auo3ddHN5ATtQ7aOT" />
                <t:Updates>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:MeetingTimeZone" />
                    <t:CalendarItem>
                      <t:MeetingTimeZone TimeZoneName="UTC" />
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="item:Subject" />
                    <t:CalendarItem>
                      <t:Subject>Changed!!!</t:Subject>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="item:Body" />
                    <t:CalendarItem>
                      <t:Body BodyType="HTML" />
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:Start" />
                    <t:CalendarItem>
                      <t:Start>2012-09-17T12:00:00.000+03:00</t:Start>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:End" />
                    <t:CalendarItem>
                      <t:End>2012-09-17T14:00:00.000+03:00</t:End>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:Location" />
                    <t:CalendarItem>
                      <t:Location>Meeting Room</t:Location>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="item:Sensitivity" />
                    <t:CalendarItem>
                      <t:Sensitivity>Normal</t:Sensitivity>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="item:Importance" />
                    <t:CalendarItem>
                      <t:Importance>Low</t:Importance>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:UID" />
                    <t:CalendarItem>
                      <t:UID>040000008200E00074C5B7101A82E00807DC0911A02BDD43F58FCD01000000000000000010000000D8DC0E085006164FA6C519630A043586</t:UID>
                    </t:CalendarItem>
                  </t:SetItemField>
                  <t:SetItemField>
                    <t:FieldURI FieldURI="calendar:MeetingTimeZone" />
                    <t:CalendarItem>
                      <t:MeetingTimeZone TimeZoneName="UTC" />
                    </t:CalendarItem>
                  </t:SetItemField>
                </t:Updates>
              </t:ItemChange>
            </m:ItemChanges>
          </m:UpdateItem>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    

    EWS Response:

    <Trace Tag="EwsResponse" Tid="8" Time="2012-09-11 08:15:14Z" Version="14.03.0067.001">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <soap:Header>
          <t:ServerVersionInfo MajorVersion="8" MinorVersion="1" MajorBuildNumber="240" MinorBuildNumber="5" Version="Exchange2007_SP1" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
        </soap:Header>
        <soap:Body>
          <m:UpdateItemResponse xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
            <m:ResponseMessages>
              <m:UpdateItemResponseMessage ResponseClass="Error">
                <m:MessageText>Set action is invalid for property.</m:MessageText>
                <m:ResponseCode>ErrorInvalidPropertySet</m:ResponseCode>
                <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
                <m:MessageXml>
                  <t:FieldURI FieldURI="calendar:MeetingTimeZone" />
                </m:MessageXml>
                <m:Items />
              </m:UpdateItemResponseMessage>
            </m:ResponseMessages>
          </m:UpdateItemResponse>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    

    And when I'm trying to update occurrence without setting timezone EWS trace shows me only last request/response where I get occurrence but not with update request. So I run in appointment.Update() get error: "StartTimeZone required when setting the Start, End, IsAllDayEvent, or Recurrence properties.  You must load or assign this property before attempting to update the appointment." and there no EWS traces regarding this update.

    Tuesday, September 11, 2012 8:25 AM
  • > And when I'm trying to update occurrence without setting timezone EWS trace shows me only last request/response

    The first error your getting is due to internal validation within the Managed API failing as a general rule you should be using the TimeZone to avoid problems.

    With the "Set action is invalid for property" I don't see anything wrong with your request the patch level of the server it quite behind eg it's running SP1 Rollup 5 where the latest for Exchange 2007 is SP3 Rollup 8 (even with SP1 there is Rollup 10). So this could be related to fixed bug.

    Cheers
    Glen

    Wednesday, September 12, 2012 7:05 AM