在Exchange 2007 SP1中使用ConvertId方法的公用文件夹联系人 [英] Using the ConvertId method in Exchange 2007 SP1 for Public Folder Contacts

查看:88
本文介绍了在Exchange 2007 SP1中使用ConvertId方法的公用文件夹联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前的开发任务是将我们的Web应用程序的联系人集成到Exchange中并提供双向更新。

我成功地将应用程序交给Exchange端工作,并且我们存储了生成的Item Id和Change Key值对于我们的SQL Server数据库中的交叉引用表中的每个联系人。

我们遇到的问题是,当我们在公共文件夹中使用OnSave和OnDelete的事件接收器时,我们需要获得相同的ID。为了使用EWS方法来处理动作。

我们的事件Sinks fire,我们得到PR_ENTRY_ID的mapi值。我们使用ConvertId方法将其转换为匹配的ItemId值,以使用GetItem()查找项目。但是,ConvertId()生成的ID与数据库交叉引用表中存储的值不匹配(至少不与公用文件夹中的联系项目相匹配),并且当我使用GetItem()从交换中检索它们时不返回任何记录EWS。

我之前已经将推送通知视为一种替代方法,但我们的团队已经决定我们不能使用这种方法,因为它可以在不通知呼叫者的情况下取消订阅。< br>
我的问题是为什么ConvertId()为给定的entryid生成的数字与已经交换的值不同?如何获得正确的ID?

我的同事已成功获得了查找邮箱项目的相同代码。 ConvertId()方法强制您在AlternateIdType对象中传递邮箱值,但我不认为公共联系人文件夹具有邮箱。除了邮箱用户的电子邮件地址之外,我应该在这里放什么价值?

我还将EntryId手动转换为OWA Id然后通过ConvertId将其放入并获得完全相同的结果(项目没有找到EWS调用GetItem())。

这是我的代码:

Our current development task is to integrate our web application's Contacts into Exchange and provide two-way updates.

I successfully got the application to Exchange side working, and we store the resultant Item Id and Change Key values for each contact in a cross-reference table in our SQL Server database.

The problem we have is that we need to get the same Ids when using Event Sinks for OnSave and OnDelete on our Public Folder for contacts, in order to use the EWS methods to process the action.

Our Event Sinks fire, we get the mapi value for PR_ENTRY_ID.  We use the ConvertId method to convert this into a matching ItemId value to look up the item using GetItem().  However, the ids produced by ConvertId() do not match the value stored in our database's cross reference table (at least not for Contact items in a Public Folder), and return no record when I use GetItem() to retrieve them from exchange using EWS.

I have previously looked into Push Notification as an alternative approach, but our  team has  decided that we can't use this approach due to the fact it can unsubscribe itself without notifying the caller under some circumstances.

My question is why do the numbers generated by ConvertId() for a given entryid differ from the value already held in exchange?  How do I get the correct id?

My colleague has successully got the same code working for looking up mailbox items.  The ConvertId() method forces you to pass a Mailbox value in the AlternateIdType object, but I don't think public Contacts folders have mailboxes.  What value should I be puting in here  other than the email address of a mailbox user?

I also did a manual conversion of an EntryId to an OWA Id then put it through ConvertId and got exactly the same results (item not found by an EWS call to GetItem()).

Here is my code:




代码块

推荐答案

Hello Peter,

您需要使用 AlternatePublicFolderItemIdType 类而不是AlternateIdType来转换存储在公用文件夹中的联系人的ID。请注意,您还需要联系人所属文件夹的PR_ENTRY_ID。

You need to use the AlternatePublicFolderItemIdType class instead of AlternateIdType to convert the Id of a contact stored in a public folder. Note that you will also need the PR_ENTRY_ID of the folder the contact belongs to.


这篇关于在Exchange 2007 SP1中使用ConvertId方法的公用文件夹联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆