Since Exchange 2016, the extended property PidLidResponseStatus gives Strings. But it is defined as MapiPropertyType.Integer: Here is how it is defined:
ExtendedPropertyDefinition PidLidResponseStatus = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x00008218, MapiPropertyType.Integer);
https://msdn.microsoft.com/en-us/library/office/cc839923.aspx
Is this a Bug in Exchange EWS?
At the Moment I am using this workaround:
object propval = null;
if (sourceitem.TryGetProperty(PidLidResponseStatus, out propval))
{
try
{
isMeetingDeclined = (int)propval == 4; // olResponseDeclined
}
catch (InvalidCastException)
{
// Bei Exchange 2016/Office 365 leider als String
/*Unknown
Organizer
Tentative
Accept
Decline
NoResponseReceived */
isMeetingDeclined = ((String)propval == "Decline");
}
}
Is there somebody who knows something about it? Or is there something I am doing wrong?
This is the Soap response:
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
<t:ExtendedProperty>
<t:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33304" PropertyType="Integer" />
<t:Value>Organizer</t:Value>
</t:ExtendedProperty>
</t:CalendarItem>
</m:Items>
</m:GetItemResponseMessage>