0

我使用 Exchange Server 2010 托管 EWS 托管 API。当我执行请求 FindItem 时,我从服务器收到错误 - “ErrorIncorrectSchemaVersion” “请求有效,但未在 RequestServerVersion SOAP 标头中指定正确的服务器版本。确保使用正确的 RequestServerVersionValue 设置 RequestServerVersion SOAP 标头。” 但在 XML 中,我将 RequestServerVersionValue 指定为 Exchange2010。我还尝试指定 Exchange2007、Exchange2007_SP1、Exchange2010_SP1,但没有任何改变。

  <?xml version="1.0" ?> 
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SOAP-ENV:Body>
- <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" Traversal="Shallow">
- <ItemShape>
  <BaseShape xmlns="http://schemas.microsoft.com/exchange/services/2006/types">IdOnly</BaseShape> 
  </ItemShape>
  <IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning" /> 
- <ParentFolderIds>
- <DistinguishedFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Id="calendar">
- <Mailbox>
  <EmailAddress>test@test1.com</EmailAddress> 
  </Mailbox>
 </DistinguishedFolderId>
  </ParentFolderIds>
  </FindItem>
- <ExchangeImpersonation xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
- <ConnectingSID>
 <PrimarySmtpAddress>test@test1.com</PrimarySmtpAddress> 
 </ConnectingSID>
  </ExchangeImpersonation>
  <MailboxCulture xmlns="http://schemas.microsoft.com/exchange/services/2006/types">US-en</MailboxCulture> 
  <RequestServerVersion xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2010" /> 
- <TimeZoneContext xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
- <TimeZoneDefinition Id="FLE Standard Time">
- <Periods>
  <Period Id="FLE Standard Time" /> 
  </Periods>
  </TimeZoneDefinition>
  </TimeZoneContext>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
4

1 回答 1

1

您有一个应该位于 SOAP 标头中的 XML 块,如下所示:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
  <ExchangeImpersonation xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
    <ConnectingSID>
    <PrimarySmtpAddress>developer@[snip].nl</PrimarySmtpAddress> 
    </ConnectingSID>
  </ExchangeImpersonation>
  <MailboxCulture xmlns="http://schemas.microsoft.com/exchange/services/2006/types">US-en</MailboxCulture> 
  <RequestServerVersion xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2010" /> 
  <TimeZoneContext xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
    <TimeZoneDefinition Id="FLE Standard Time">
      <Periods>
        <Period Id="FLE Standard Time" /> 
      </Periods>
    </TimeZoneDefinition>
  </TimeZoneContext>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" Traversal="Shallow">
    <ItemShape>
      <BaseShape xmlns="http://schemas.microsoft.com/exchange/services/2006/types">IdOnly</BaseShape> 
    </ItemShape>
    <IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning" /> 
    <ParentFolderIds>
      <DistinguishedFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Id="calendar">
        <Mailbox>
          <EmailAddress>developer@[snip].nl</EmailAddress> 
        </Mailbox>
      </DistinguishedFolderId>
    </ParentFolderIds>
  </FindItem>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>    

运行它会给你下一个错误 ;-)
ErrorTimeZone - 周期的 Bias 属性设置为 null

我用 SoapUI 发现了这个测试(提示!)

于 2013-01-11T15:31:08.210 回答