0

我向 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>

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

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

有谁理解这个验证错误,还是一个错误?

Exchange 版本为 15.0.913.19

4

1 回答 1

2

尝试在 SOAP 标头中添加RequestServerVersion元素并将其设置为至少Exchange2010.

于 2015-03-04T16:18:47.557 回答