I have a Java SE application that uses Exchange Web Services for Java 1.1.5 (also tried 1.2) to retrieve a folder from an Exchange server. The app asks for an additional property which is the mailbox store entry id, which is a Base64 encoded string representing a MAPI store id (PR_STORE_ENTRYID, 0x0FFB in hex or 4091 in decimal). This store id is passed to a MAPI client along with the folder entry id to access messages within the folder. The code works fine with Exchange 2007 SP1, Exchange 2010, Exchange 2010 SP1 and Exchange 2010 SP2 but has stopped working with Exchange 2010 SP3.
I have debugged EWS code and the SOAP response from Exchange appear to contain a partially corrupted or invalid value for the store id. More specifically, most of the encoded data is correct, only the last part of the data that is supposed to contain a null-terminated string for the mailbox distinguished name is garbled. The data does not end with a null character and it looks nothing like what I expect. For example, the mailbox DN part of the data should look something like:
/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Dev01 02
but what the app receives is:
The Java code looks something like:
ExtendedPropertyDefinition PR_STORE_ID_DEFN = new ExtendedPropertyDefinition(0x0FFB, MapiPropertyType.Binary);
FolderView view = new FolderView(10);
view.setPropertySet(new PropertySet(BasePropertySet.IdOnly, FolderSchema.DisplayName, FolderSchema.EffectiveRights, PR_STORE_ID_DEFN));
FolderId parentId = FolderId.getFolderIdFromWellKnownFolderName(WellKnownFolderName.MsgFolderRoot);
IsEqualTo filter = new SearchFilter.IsEqualTo(FolderSchema.DisplayName, "Some Folder");
FindFoldersResults folders = service.findFolders(parentId, filter, view);
Folder folder = folders.getFolders().get(0);
byte storeId = (byte)folder.getExtendedPropertiesForService().getPropertyAtIndex(0).getValue();
(the code is missing some traversal logic that finds the folder, but it shows the general idea)
Does anyone have any idea what might be wrong?
Thanks in advance.