问题
Every Item (e.g. Task) in Exchange Web Services (EWS) Managed API has an Id
property of type ItemId, which then has a String
property named UniqueId (inherited from ServiceId — phew, got that?).
I'm planning to keep the value of UniqueId
in a database so I need to know what the maximum length of the column should be. Some testing shows that it's at least 152
bytes in length, but that seems like a strange size for a maximum.
A second part to this question is the format of the value. Is this something that can be parsed into a more common type, like a Guid? I'm grasping at straws, I know.
回答1:
To be safe, we've suggested setting aside 512 characters for the EWS identifier. While I don't expect that it will ever be lengthened to near 512 characters, Microsoft reserves the right to change the format. I highly doubt Exchange will change the format at this point.
Regarding the format of the identifier -- it is intended to be opaque and so it should be neither parsed nor reconstructed.
回答2:
From EWS Identifiers in Exchange:
- The ItemID element value for folders and items is case-sensitive. If you look at the item ID for a folder or item that is returned by the FindItem operation (or the FindItems EWS Managed API method), you might think that it is a duplicate of another item ID; however, one or more characters in the item IDs for the two items will have a different case.
- If you are going to store the item ID in a database to retrieve later, we recommend that the field size be 512 bytes, so that it’s large enough to hold the GUID.
- Don’t assume that your ID will always be valid if you need to retrieve the item at a later time. If an item is moved in the store, the ID can change because of the way a move is handled. An item is actually copied, and a new ID is generated, and then the original item is deleted.
来源:https://stackoverflow.com/questions/15770929/serviceid-uniqueid-maximum-length-and-format