【发布时间】:2019-02-11 16:57:26
【问题描述】:
我在 Office 365 租户中有多个用户帐户,并分配了许可证。当我尝试使用 FindFolder operation 从包含下一个正文的 EWS API 获取用户邮箱中的信息(例如所有文件夹和项目)时:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013"/>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrincipalName>name.surname@mydomain.be</t:PrincipalName>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<FindFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" Traversal="Shallow">
<FolderShape>
<t:BaseShape>AllProperties</t:BaseShape>
</FolderShape>
<IndexedPageFolderView MaxEntriesReturned="1000" BasePoint="Beginning" Offset="0"/>
<ParentFolderIds>
<t:DistinguishedFolderId Id="msgfolderroot"/>
</ParentFolderIds>
</FindFolder>
</soap:Body>
</soap:Envelope>
(name.surname@mydomain.be 是目标 Office 365 帐户的用户主体名称)我收到下一个正文的错误回复:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1601" MinorBuildNumber="24" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:FindFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:FindFolderResponseMessage ResponseClass="Error">
<m:MessageText>Mailbox does not exist.</m:MessageText>
<m:ResponseCode>ErrorNonExistentMailbox</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
</m:FindFolderResponseMessage>
</m:ResponseMessages>
</m:FindFolderResponse>
</s:Body>
</s:Envelope>
GetFolder operation 给了我同样的结果。
此错误通常是由未经许可的邮箱帐户引起的。但我所有的用户都有有效的 Exchange 许可证。为什么会收到这样的 ErrorNonExistentMailbox 错误响应?
【问题讨论】:
-
您是指定邮箱的主 SMTP 地址还是代理地址之一?
-
我使用 upn(用户主体名称)。
标签: outlook office365 exchangewebservices