Exchange Web 服务:为什么 ItemId 不恒定?
我编写了一个小型应用程序,它应该自动处理公共文件夹中的电子邮件。对于每封电子邮件,我们希望在数据库中保存一些元数据。
我想使用 ItemID 来建立此元数据和特定电子邮件之间的链接,但我刚刚发现此 ItemId 不是恒定的。例如,如果电子邮件从公共文件夹移动到另一个文件夹,它将收到另一个 ItemId。这意味着电子邮件和相关元数据之间的链接丢失。
那么,问题是,如何在元数据和特定电子邮件之间建立链接?
I write a small application, which should automatically process the emails from a public folder. For each email, we want to save some metadata, in a database.
I wanted to use the ItemID to make the link between this metadata and a specific email, and I have just discovered that this ItemId is not constant. For example, if the email is moved from a public folder to another, it will receive another ItemId. That means, that the link between the email and the associated metadata is lost.
So, the problem is, how can I make the link between the metadata and the specific email?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的理解是,EWS 唯一 ID 包含某种形式的 EntryId。因此,一旦元素移动到另一个文件夹,它就会发生变化。
虽然此处不适用,但日历条目的情况更为复杂,因为 Exchange 在某些情况下会销毁并重新创建约会,从而更改唯一 ID。
此页面(http://msdn.microsoft.com/en-us/library/cc815908.aspx) 包含可用于识别对象的 MAPI 属性的概述。另一种方法是您可以将自己的 id 属性添加到 Exchange 元素(通过扩展属性)。
My understanding is, that the EWS unique id contains the EntryId in some form. Therefore, it will change once the element is moved to another folder.
And while not applicable here, the situation is more complicated with calendar entries, as Exchange destroys and recreates an appointment under certain circumstances, thereby changing the unique id.
This page (http://msdn.microsoft.com/en-us/library/cc815908.aspx) contains an overview over MAPI properties which can be used to identify an object. An alternative to this is that you can add your own id property to the Exchange element (via extended property).
项目 ID 更改。它并不自始至终保持独特。
为了访问一项,可以使用 GUID。
(下面的 SOAP 请求用于获取日历项目。)
您可以在 FindItem 调用中使用 GUID 获取有关项目的信息
Item ID Changes. It doesn't remain unique throughout.
For accessing an item, one can use GUID.
(The SOAP Request below is for fetching a calendar item.)
You can fetch information about an item using GUID in a FindItem call
您必须将 EntryItemId 转换为 EWS 唯一项目 ID,然后您可以用作主键来创建数据库条目
看看:
链接
you have to convert the EntryItemId to EWS unique item id then you can use as primary key to create an entry into the DB
Have a look at:
Link