问题
I have a problem whit EWS (Exchange Webservice)
I send an request for 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>
and get following xml from server
<?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>
So why the Server say that Traversal is missing ?
(I also have tested it with the T:Traversal = Deep
T: for the namespaceentry for the types)
Can someone can help me with this problem?
回答1:
Traversal is required on the FindFolder
element. Try changing it from...
<M:FindFolder>
<!-- ... -->
To this...
<M:FindFolder Traversal="Deep">
<!-- ... -->
The Traversal
attribute 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:
i have tryed following constellations
<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.
来源:https://stackoverflow.com/questions/12176625/ews-the-required-attribute-traversal-is-missing