EWS:来自 Exchange 2013 的意外 SOAP 验证错误

EWS: unexpected SOAP validation error from Exchange 2013

我使用 JAX-WS 发出请求:

GetItemType itemRequest = new GetItemType()
    .withItemShape(new ItemResponseShapeType()
        .withBaseShape(DefaultShapeNamesType.ID_ONLY)
        .withAdditionalProperties(new NonEmptyArrayOfPathsToElementType()
            .withPath(objectFactory.createFieldURI(new PathToUnindexedFieldType()
                .withFieldURI(UnindexedFieldURIType.ITEM_WEB_CLIENT_EDIT_FORM_QUERY_STRING)
                )
            )
        )
    )
    .withItemIds(new NonEmptyArrayOfBaseItemIdsType()
        .withItemIdOrOccurrenceItemIdOrRecurringMasterItemId(new ItemIdType()
            .withId(id)
        )
    );

产生一条肥皂消息:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <ns3:MailboxCulture xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages">nb-NO</ns3:MailboxCulture>
  </soap:Header>
  <soap:Body>
    <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types">
      <ItemShape>
        <ns2:BaseShape>IdOnly</ns2:BaseShape>
        <ns2:AdditionalProperties>
          <ns2:FieldURI FieldURI="item:WebClientEditFormQueryString"/>
        </ns2:AdditionalProperties>
      </ItemShape>
      <ItemIds>
        <ns2:ItemId Id="AQAZAEF4ZWwuV2F0aG5lQHNwYXJlYmFuazEubm8ARgAAA7k+kh3x38JJgjb3IcQO3bAHAP4YJIRG6m5GkZN2+/hve1MAAAIBEAAAAP4YJIRG6m5GkZN2+/hve1MAAAIbBgAAAA=="/>
      </ItemIds>
    </GetItem>
  </soap:Body>
</soap:Envelope>

并得到这样的回应:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <s:Fault>
      <faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode>
      <faultstring xml:lang="nb-NO">The request failed schema validation: The 'FieldURI' attribute is invalid - The value 'item:WebClientEditFormQueryString' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:UnindexedFieldURIType' - The Enumeration constraint failed.</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 request failed schema validation.</e:Message>
        <t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
          <t:LineNumber>1</t:LineNumber>
          <t:LinePosition>534</t:LinePosition>
          <t:Violation>The 'FieldURI' attribute is invalid - The value 'item:WebClientEditFormQueryString' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:UnindexedFieldURIType' - The Enumeration constraint failed.</t:Violation>
        </t:MessageXml>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>

所以它似乎不喜欢值 item:WebClientReadFormQueryString,但根据 EWS types.xsd 中的枚举,这对我来说似乎是正确的:

<xs:simpleType name="UnindexedFieldURIType">
    <xs:restriction base="xs:string">
        ...
        <xs:enumeration value="item:WebClientReadFormQueryString"/>

有没有人理解这个验证错误,或者这是一个错误?

Exchange 版本为 15.0.913.19

尝试在您的 SOAP header 中添加一个 RequestServerVersion 元素并将其至少设置为 Exchange2010