如何使用WebDAV来匹配DAV:HREF到Outolook互操作href的值 [英] How to use WebDav to match dav:href to Outolook Interop href value

查看:165
本文介绍了如何使用WebDAV来匹配DAV:HREF到Outolook互操作href的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有previously使用WebDAV的访问基础上的主题和时间的Exchange 2003服务器上发送的消息,这已经奏效。

I have previously used webdav to access the sent messages on an exchange 2003 server based on the subject and time and this has worked.

我现在需要实现这意味着来自客户端的Outlook(没有网络访问)到Windows窗体,然后查询WebDAV的外汇拖着一条消息,另一种功能来获取所有有关此消息的信息。

I now need to implement another feature which means dragging a message from client outlook (not web access) on to a windows form then querying webdav on exchange to get all the information about this message.

我能得到的消息HREF使用下面的code:

I can get the messages href using the following code:

Dim msg As MAPI.Message = CType(session.GetMessage(mail.EntryID), MAPI.Message)
Dim id as string = CType(CType(msg.Fields(), MAPI.Fields).Item(&H6707001E), MAPI.Field).Value.ToString

不过有两个问题;

However there are two issues;

1)对URL编码是我从被拖动的消息得到的,什么是带来了从WebDAV的背面之间的不同(我可以看到这些我问的所有邮件)。

1) The encoding on the URL is different between what I get from the dragged message and what is brought back from webdav (I can see these if I ask for all mail).

2)无论我如何格式化查询,它从来没有带回来的结果,即使我复制HREF从列表中当我把所有讯息。

2) No matter how I format the query it never brings back results even if I copy the href from the list when I bring back all messages.

下面是一个搜索请求失败的样本(如果你删除的作品在where子句):

Here is a sample of a search request that fails (works if you remove the where clause):

    <?xml version="1.0" ?>
    <D:searchrequest xmlns:D="DAV:">
        <D:sql>SELECT "DAV:contentclass","DAV:href", "DAV:displayname","urn:schemas:httpmail:datereceived","urn:schemas:httpmail:subject" 
FROM "https://server/exchange/mailbox" WHERE "DAV:href"='/Inbox/email.EML'</D:sql>
    </D:searchrequest>

我一直在使用相对语法按这篇文章但已经尝试了许多组合。

I have been using relative syntax as per this article but have tried many combinations.

推荐答案

这是相当长篇大论,但我还没有找到一个这样做的更好的方式:

This is quite long winded, but I have yet to find a better way of doing this:

该Outlook.MailItem.EntryID包含4个GUID的,虽然我不知道他们所有的地图。最后一个GUID包含您所追求的信息。

The Outlook.MailItem.EntryID contains 4 Guids, although I am not sure what they all map to. The last guid contains the information you are after.

00000000E6053DD369FAB340B6B8C4D77A0
B37D30700173A23D2AA06A3488E75E759DD
1ACBBB00000A6F78CC00007B9F3D877B316
4499DE695FBB7FCDE5F00000 EBD83B9 0000

00000000E6053DD369FAB340B6B8C4D77A0
B37D30700173A23D2AA06A3488E75E759DD
1ACBBB00000A6F78CC00007B9F3D877B316
4499DE695FBB7FCDE5F00000 EBD83B9 0000

中的加粗部分为消息ID,我们可以使用(所有的邮件在我的收件箱,只有这7个数字是他们进入ID之间的不同)。

The bold part is the Messages ID that we can use (Of all the messages in my inbox, only these 7 digits were different between their entry IDs).

接下来,修改您的WebDAV查询带回 DAV:permanenturl 属性。这将如下所示:

Next, modify your webDAV query to bring back the DAV:permanenturl property. This will look like the following:

https://SERVER%5FNAME/exchange/MAILBOX@DOMAIN>COM/-FlatUrlSpace-/173a23d2aa06a3488e75e759dd1acbbb-a6f78cc/7b9f3d877b3164499de695fbb7fcde5f-ebd83b9

https://SERVER%5FNAME/exchange/MAILBOX@DOMAIN>COM/-FlatUrlSpace-/173a23d2aa06a3488e75e759dd1acbbb-a6f78cc/7b9f3d877b3164499de695fbb7fcde5f-ebd83b9

因此​​,所有你需要做的匹配是做一个WebDAV查询指定邮箱中的所有项目,遍历比较 PermanentURL 使用的的EntryID 部分找到你的比赛。

So all you need to do for matching is to do a webDAV query for all the items in the specified mailbox, loop through comparing the PermanentURL with part of the EntryID to find your match.

我会更开心,如果有对WebDAV的一个的EntryID,但似乎并没有成为一个直接访问的。

I would be happier if there was an EntryID on the webDAV, but there does not seem to be a directly accessible one.

这篇关于如何使用WebDAV来匹配DAV:HREF到Outolook互操作href的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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