
php小编百草在这里向大家介绍一种利用Exchange Web服务的方法,通过使用SOAP XML请求来查找所有未读消息。Exchange Web服务是一种用于与Exchange Server通信的API,它提供了访问和管理电子邮件、日历、联系人等功能的能力。通过使用SOAP XML请求,我们可以向Exchange Server发送请求,并获取返回的数据。在这篇文章中,我们将详细介绍如何使用SOAP XML请求来查找所有未读消息。
在我的应用程序中,我需要查询 echange web 服务服务器并查找所有未读消息。我正在使用 golang,并且正在发送soap xml 请求。我尝试了以下方法:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem
Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
</m:ItemShape>
<m:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="item:IsRead" />
<t:FieldURIOrConstant>
<t:Constant Value="false" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="inbox" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>但在这种情况下,我收到错误消息,表明我的请求不正确。如果我删除 <t:isequalto>,我会在收件箱中收到所有消息。任何如何修复它的想法都将受到欢迎。谢谢
根据 fielduri 属性列表,item:isread 应为 message:isread。以下是从 ews 中的平等过滤器
一>:
<t:IsEqualTo>
<t:FieldURI FieldURI="message:IsRead" />
<t:FieldURIOrConstant>
<t:Constant Value="false" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
以上就是Exchange Web 服务 - 使用soap xml 请求查找所有未读消息的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号