0

I make a request with 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)
        )
    );

Which yields a soap message:

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

And get this response:

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

So it seems to not like the value item:WebClientReadFormQueryString, but this seems correct to me, according to the enumeration in types.xsd from EWS:

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

Does anyone understand this validation error, or is it a bug?

Exchange version is 15.0.913.19

AxelW
  • 319
  • 1
  • 7

1 Answers1

2

Try adding a RequestServerVersion element in your SOAP header and setting it to at least Exchange2010.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
  • For future reference: Adding the RequestServerVersion resulted in more fields returned for shape AllProperties, including the one I was after. This aligns with the documentation at https://msdn.microsoft.com/en-us/library/office/dn600367(v=exchg.150).aspx - i guess omitting the RequestServerVersion leads Exchange to assume I expect an older version of the API. – AxelW Mar 05 '15 at 14:55
  • Yes ... per https://msdn.microsoft.com/EN-US/library/office/bb856547(v=exchg.150).aspx, when the client omits the field, Exchange will handle the request as "from the initial release version of Exchange 2007" – Erich Musick Apr 14 '15 at 01:14