【问题标题】:EWS The required attribute 'Traversal' is missingEWS 缺少必需的属性“遍历”
【发布时间】:2012-08-30 20:31:30
【问题描述】:

我遇到了 EWS 问题(Exchange Webservice

我发送FindFolders的请求

<?xml version="1.0"?>
<soap12:Envelope xmlns:soap12="http://schemas.xmlsoap.org/soap/envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:M="http://schemas.microsoft.com/exchange/services/2006/messages" soap12:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:T="http://schemas.microsoft.com/exchange/services/2006/types">
 <soap12:Body>
  <M:FindFolder>
   <request SOAP-ENC:id="1" xsi:type="M:FindFolder" Traversal="Deep">
    <FolderShape xsi:nil="true"/>
    <IndexedPageFolderView SOAP-ENC:id="2" xsi:type="T:IndexedPageViewType" Offset="0" BasePoint="Beginning"/>
    <ParentFolderIds xsi:nil="true"/>
   </request>
   <Impersonation xsi:nil="true"/>
   <S2SAuth xsi:nil="true"/>
   <MailboxCulture xsi:type="xsd:string">de-DE</MailboxCulture>
   <RequestVersion SOAP-ENC:id="3" xsi:type="T:RequestServerVersion"   Version="Exchange2007_SP1"/>
  </M:FindFolder>
 </soap12:Body>
</soap12:Envelope>

并从服务器获取以下 xml

    <?xml version="1.0"?>
    <soap11:Envelope xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/">
     <soap11:Header>
      <t:ServerVersionInfo MajorVersion="8" MinorVersion="3" MajorBuildNumber="245" MinorBuildNumber="0" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
     </soap11:Header>
     <soap11:Body>
      <soap11:Fault>
       <faultcode>soap11:Client</faultcode>
       <faultstring>The request failed schema validation: The required attribute 'Traversal' is missing.</faultstring>
       <detail>
        <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
        <e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">

The required attribute 'Traversal' is missing.

        </e:Message>
        <e:Line xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">2
        </e:Line>
        <e:Position xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">446
        </e:Position>
       </detail>
      </soap11:Fault>
     </soap11:Body>
    </soap11:Envelope>

那么为什么服务器说 Traversal 丢失了?

(我也用T:Traversal = DeepT: 为类型的命名空间条目测试了它)

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: exchangewebservices traversal


    【解决方案1】:

    Traversal is requiredFindFolder 元素上。尝试将其更改为...

    <M:FindFolder> 
       <!-- ... -->
    

    到这里……

    <M:FindFolder Traversal="Deep"> 
       <!-- ... -->
    

    Traversal 属性must adhere to the following XSD schema

    <simpleType name="FolderQueryTraversalType">
       <restriction base="{http://www.w3.org/2001/XMLSchema}string">
         <enumeration value="Shallow"/>
         <enumeration value="Deep"/>
         <enumeration value="SoftDeleted"/>
       </restriction>
     </simpleType>
    

    【讨论】:

    【解决方案2】:

    我试过追星

    <M:FindFolder M:Traversal="DEEP>
    The request failed schema validation: The 'http://schemas.microsoft.com/exchange/services/2006/messages:Traversal' attribute is not declared.
    
    <M:FindFolder T:Traversal="DEEP>
    The request failed schema validation: The 'http://schemas.microsoft.com/exchange/services/2006/types:Traversal' attribute is not declared.
    
    
    <M:FindFolder Traversal="DEEP">
    
    The request failed schema validation: The 'Traversal' attribute is invalid - The value 'DEEP' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:FolderQueryTraversalType' - The Enumeration constraint failed.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多