DCSIMG
עמוד הבית| חבילות השירות שלנו| חומר חופשי| צור קשר
Exchange Web Service (EWS) and Versioning - בלוג היועצים של מיקרוסופט ישראל

בלוג היועצים של מיקרוסופט ישראל

Exchange Web Service (EWS) and Versioning

Lately I introduced to a great API from the Exchange team, that simplify the working with the EWS.
If you are working with EWS, hurry up and take a look on this
API
.

When I started to play with this API, I noticed that I have no problem to create items and update them,
but if I tried to update an item that was created by the EWS (and not by the Managed API), I have got this exception:
"The EWS Id specified is in Exchange 2007 RTM format while your request was made in the Exchange2007_SP1 mode.
Please use the Exchange2007 SOAP version header in your request or remove it,
or use ConvertId method to convert Id from EwsLegacyId to EwsId format."

So, I searched information about this error and found this post (
http://calendarservermigration.blogspot.com/2008/05/meetings-created-in-ews-rtm-format-can.html
) that talk about the differences between item ID in Exchange 2007 RTM and Exchange 2007 SP1.
Shortly, this error thrown when you are trying to read/update an item that created with Exchange 2007 RTM EWS,
with EWS (or Managed API) of Exchange 2007 sp1.

Also, I read this
article
and I learned that I can set the EWS Managed API target version like that:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

So, I did it.
And… still I have got the exception….

Since I created items by EWS of Exchange 2007 sp1 and tried to update those items with the Managed API (that I set its version to "Exchange2007_SP1") I should not get an error…

After some digging I found this
article that said that we can (and need) to set the EWS version, because its default version is "Exchange2007
".

So, if you will have this error you should set the version of the EWS Manged API:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

And set the EWS version:
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.RequestServerVersionValue = new RequestServerVersion();
esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;


Good luck

פורסם: Jul 18 2009, 10:48 PM by Tal Ben-Shalom | with no comments
תגים:, ,
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 3 and 4 and type the answer here:


Enter the numbers above: