OfficeDev / ews-managed-api

Other
585 stars 322 forks source link

"A referenced period is missing." Timezone related error. #161

Open oranasraf opened 6 years ago

oranasraf commented 6 years ago

While working on a syncing software for one of my clients. One of the users repeatedly (but! not always) throws exception of: "A referenced period is missing., A referenced period is missing. " When trying to save / update an appointment.

As mentioned in #74 and a quick search in google it's looks like a time zone related error but without any explanation.

From a look at the user office client (outlook 2010), the user regional settings on the desktop and the regional settings on the server everything looks good. keep in mind other users works fine.

Any insights?

Stack trace provided:

A referenced period is missing., A referenced period is missing. at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary() at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest1.Execute() at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable1 items, FolderId parentFolderId, Nullable1 messageDisposition, Nullable1 sendInvitationsMode, ServiceErrorHandling errorHandling) at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateItem(Item item, FolderId parentFolderId, Nullable1 messageDisposition, Nullable1 sendInvitationsMode) at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable1 messageDisposition, Nullable1 sendInvitationsMode) at Microsoft.Exchange.WebServices.Data.Appointment.Save(WellKnownFolderName destinationFolderName, SendInvitationsMode sendInvitationsMode) at LuzerImporter.Classes.Exchange.CreateOrModify(LuzerEvent lEvent, Appointment appItem, Int32 nRetry)

The request is not supported

davster commented 6 years ago

Can you post your timezone request header? Sounds like the timezone definitions has an incomplete set of transition periods.

oranasraf commented 6 years ago

Hi, @davster i'm using the EWS API, how can i find the timezone header? (which variable in the ews service)

LitvinovAndrey commented 6 years ago

Hi @oranasraf, did you solve this problem?

oranasraf commented 6 years ago

@LitvinovAndrey Unfortunately no. Do you have any insights?

LitvinovAndrey commented 6 years ago

@oranasraf I change the EWS schema version to Exchange2007_SP1 and now it works fine https://blogs.msdn.microsoft.com/webdav_101/2017/09/16/when-a-certain-time-zone-does-not-work-with-the-ews-managed-api/

oranasraf commented 6 years ago

@LitvinovAndrey Did you have the same error as mine? If ill change the schema to 2007 i will miss some of my features i'm using.

andreyvolodko commented 4 years ago

@LitvinovAndrey Did you have the same error as mine? If ill change the schema to 2007 i will miss some of my features i'm using.

If it's still relevant, you do NOT have to use 2007 version, you just need to find out the TimeZone of your exchange server.

Like that in my case: _exchange = new ExchangeService(exchangeVersion, TimeZoneInfo.Utc);

Initialization of exchange service with version and TimeZoneInfo parameter. And it works fine.