EWS access to contact fields

Hi Pros,

referring to this post I can create a contact in public Folders via ews. This works fine so far but when I try to send further attributes like Nickname for example I get a "ErrorSchemaValidation". Because I am sending the Message from BizTalk, I create the actual SOAP XML directly, if I understood the following site correctly, a <Nickname> should be allowed as child of contact.

<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
  <SavedItemFolderId>
    <FolderId Id="XXXXXXA="ChangeKey="XXXXXX"xmlns="http://schemas.microsoft.com/exchange/services/2006/types"/>
  </SavedItemFolderId>
  <Items>
    <Contact xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
      <FileAs>Max, Mustermann</FileAs>
      <GivenName>Adam</GivenName>
      <CompanyName>CompanyName<CompanyName>
      <EmailAddresses>
        <Entry Key="EmailAddress1">welt@hallo.uik</Entry>
      </EmailAddresses>
      <JobTitle>Friend</JobTitle>
      <Surname>Muster</Surname>
      <Nickname>thisdontwork</Nickname>
    </Contact>
  </Items>
</CreateItem>
So what might be wrong about this message?
July 7th, 2013 7:24am

The order of the elements in the SOAP message is critical for Exchange eg if you refer to http://msdn.microsoft.com/en-us/library/exchange/aa581315(v=exchg.140).aspx the NickName element should be before EmailAddresses.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
July 8th, 2013 2:24am

Hi Glen,

makes sense and works fine, thanks!

I have a similar issue with the FindItem message, when searching for the nickname the following message works. when I replace nickname by other properties like 'ContactSource' or 'DirectoryId' I get a 'ErrorUnsupportedPathForQuery' error. What is the difference between these elements and how can I know it if not from this site ?

<FindItem Traversal='Shallow' xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>
      <ItemShape>
        <BaseShape xmlns='http://schemas.microsoft.com/exchange/services/2006/types'>IdOnly</BaseShape>
        <AdditionalProperties  xmlns='http://schemas.microsoft.com/exchange/services/2006/types'>
          <FieldURI FieldURI='contacts:Nickname' />
        </AdditionalProperties>
      </ItemShape>
      <IndexedPageItemView MaxEntriesReturned='2' Offset='0' BasePoint='Beginning'/>
      <Restriction>
        <Or  xmlns='http://schemas.microsoft.com/exchange/services/2006/types'>
          <Contains ContainmentMode='FullString' ContainmentComparison='Exact'>
            <FieldURI FieldURI='contacts:Nickname' />
            <Constant Value='{0}' />
          </Contains>
        </Or>
      </Restriction>
      <ParentFolderIds>
        <FolderId Id='{1}' ChangeKey='{2}' xmlns='http://schemas.microsoft.com/exchange/services/2006/types' />
      </ParentFolderIds>
    </FindItem>

July 8th, 2013 4:49am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics