EWS:Exchange 2013中出现意外的SOAP验证错误

时间:2015-03-04 15:00:36

标签: web-services soap exchangewebservices exchange-server-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>

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

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

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

Exchange版本为15.0.913.19

1 个答案:

答案 0 :(得分:1)

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