1
FindItemsResults<Item> fiResults = fFolders.getFolders().get(0).findItems(cntSearch, iv);

for (Item item : fiResults.getItems()) {
    try {
        Object wLinkAddressBookEID = null;
        item.tryGetProperty(extendedPropertyDefinition,(OutParam<Object>)wLinkAddressBookEID);
        byte[] ssStoreID = (byte[]) wLinkAddressBookEID;

Exception:

java.lang.ClassCastException: microsoft.exchange.webservices.data.property.definition.ExtendedPropertyDefinition cannot be cast to microsoft.exchange.webservices.data.property.definition.PropertyDefinition at microsoft.exchange.webservices.data.core.service.ServiceObject.tryGetProperty(ServiceObject.java:455) at microsoft.exchange.webservices.data.core.service.ServiceObject.tryGetProperty(ServiceObject.java:441)

jrbedard
  • 3,662
  • 5
  • 30
  • 34
C.J
  • 11
  • 2
  • I highly support this question as I've been trying to get the solution laterly with C# or Java (https://stackoverflow.com/questions/39920641/ews-access-shared-calendars-items-appointments). – jgran Nov 17 '16 at 18:16
  • Thanks for your reply.I've found this question. But when I try to use item.tryGetProperty, the code of ServiceObject ,try to cast PropertyDefinitionBase to PropertyDefinition, here throws java.lang.ClassCastException. Do you know why? – C.J Nov 18 '16 at 02:12
  • I could find the shared calendar folderId in MFCMAPI thanks to Glen Scales, but cannot do it programmatically (preference in Java). I don't know how to access ExtendeProperties (we need PidTagWlinkEntryId and then, decode it to get ewsId AFAIK). I get the same cast exception as you. Not very helpful, sorry. – jgran Nov 18 '16 at 09:24
  • Thanks any way. I've create issues :https://github.com/OfficeDev/ews-java-api/issues/575. – C.J Nov 21 '16 at 02:36
  • Can you mail your successed code to me? email:caojian.1224@gmail.com Thanks... – C.J Nov 23 '16 at 08:56

0 Answers0