【发布时间】:2016-03-27 01:27:20
【问题描述】:
我正在尝试获取不同服务器的 Exchange 产品版本。服务器由 Microsoft、客户或第三方服务提供商托管。 我需要一种查找版本的方法 - 这样我就可以使用正确的架构和版本指定操作(例如 Exchange2010_SP2 中引入的“获取密码过期”)。支持的最低产品版本是“Exchange2007”。 我发送到服务器以检索版本的soap请求如下。
<?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="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<GetFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<FolderShape>
<t:BaseShape>Default</t:BaseShape>
</FolderShape>
<FolderIds>
<t:DistinguishedFolderId Id="sentitems" />
</FolderIds>
</GetFolder>
</soap:Body>
</soap:Envelope>
此请求的问题是返回的服务器版本不同,并且没有清楚地显示 Exchange 产品版本。我得到的版本值类似于“V2_68”、“V2015_10_05”。由于这些值不稳定,我无法将这些值与 Exchange 产品版本匹配。
我曾尝试使用 AutoDiscover GetUserSettingsResponseMessage 操作。对于某些服务器,此操作可以返回标记 EwsSupportSchemas 中的模式。但并非所有服务器都支持自动发现。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<a:RequestedServerVersion>Exchange2010</a:RequestedServerVersion>
<wsa:Action>http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings</wsa:Action>
<wsa:To>https://myserver.contoso.com/autodiscover/autodiscover.svc</wsa:To>
</soap:Header>
<soap:Body>
<a:GetUserSettingsRequestMessage xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover">
<a:Request>
<a:Users>
<a:User>
<a:Mailbox>UserName@domain.contoso.com</a:Mailbox>
</a:User>
</a:Users>
<a:RequestedSettings>
<a:Setting>UserDisplayName</a:Setting>
<a:Setting>UserDN</a:Setting>
<a:Setting>UserDeploymentId</a:Setting>
<a:Setting>InternalMailboxServer</a:Setting>
<a:Setting>MailboxDN</a:Setting>
<a:Setting>ActiveDirectoryServer</a:Setting>
<a:Setting>CasVersion</a:Setting>
<a:Setting>EwsSupportedSchemas</a:Setting>
</a:RequestedSettings>
</a:Request>
</a:GetUserSettingsRequestMessage>
</soap:Body>
</soap:Envelope>
非常感谢。
【问题讨论】:
标签: web-services soap synchronization integration exchangewebservices