EWS - ServerVersionInfo Version attribute in responses

為{幸葍}努か 提交于 2020-01-05 09:34:44

问题


According to this:

http://msdn.microsoft.com/en-us/library/dd633705(v=exchg.80).aspx

In each EWS response, the version of Exchange that generated the response is indicated by the ServerVersionInfo element. The following example shows a ServerVersionInfo element that represents a response from Exchange 2010 SP1.

The example on that page has:

Version="Exchange2010_SP1"

I'm currently working with an Exchange Online account, and the value I'm seeing in EWS server responses is:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo [xmlns' snipped]
MajorVersion="15" MinorVersion="0" MajorBuildNumber="800" MinorBuildNumber="16"
Version="V2_6"/>
  </s:Header>

So it's Version="V2_6", which I can't find in the EWS reference.

1 - Is this to be expected for Exchange Online? What about Office 365 accounts?

2 - Where does V2_6 fit into the sequence of: Exchange2007, Exchange2007_SP1, Exchange2010, .... Exchange2013?

In other words, when I see Version="V2_6" in server responses, what schema version can I use in my requests' <RequestServerVersion>?


回答1:


I had the same issue with a V2_22 version number being returned.

Quoting from answers to my question at the Exchange Server development forum:

"Exchange for Office 365 [ed: Exchange Online] has its own life (custom build) so it does not follow the Exchange 2013 version except for the major version."

You can use the Exchange2013 RequestServerVersion when doing requests to the Office 365 EWS API. If you don't want to do that:
FreeRangeEggs suggest in his answer (here) to rely on MajorVersion, but the answer from Glen Scales (there) says to use AutoDiscovery to detect what schemas are supported.




回答2:


It looks like Version="Exchange2010_SP1" is only for sending the requests, and not part of the response.

<soap:Header>
    <t:RequestServerVersion Version="Exchange2013" />
</soap:Header>

The request version does not match the response version, and is wrapped in different tags.

<h:ServerVersionInfo MajorVersion="15"
                     MinorVersion="0"
                     MajorBuildNumber="785"
                     MinorBuildNumber="6"
                     Version="V2_6"
                     xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
                     xmlns="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"/>

I was going to suggest you use the MajorVersion, but that has only been available from 2010 up.



来源:https://stackoverflow.com/questions/19824792/ews-serverversioninfo-version-attribute-in-responses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!