2017-03-09 3 views
0

Ich möchte eine Suche von Kontakten mit einer Telefonnummer durchführen. Ich habe versucht, die FindItem Seife, aber konnte es aus irgendeinem Grund nicht funktionieren. Ich habe versucht, so etwas wie unten:Abfrage von EWS mit Telefonnummer

<?xml version="1.0" encoding="utf-8" ?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
<soap:Body> 
    <m:FindItem Traversal="Shallow"> 
     <m:ItemShape> 
      <t:BaseShape>AllProperties</t:BaseShape> 
     </m:ItemShape> 
     <m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" /> 
     <m:Restriction> 
      <t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase"> 
       <t:FieldURI FieldURI="contacts:PhoneNumbers" /> 
       <t:Constant Value="SOMEPHONENUMBER" /> 
      </t:Contains> 
     </m:Restriction> 
     <m:ParentFolderIds> 
      <t:DistinguishedFolderId Id="contacts" /> 
     </m:ParentFolderIds> 
    </m:FindItem> 
</soap:Body> 

Aber ich bin immer ein "Property cannot be used with this type of restriction" Fehler. Irgendwelche Ideen?

Antwort

1

Sie nicht, dass stark Typ Eigenschaft in einer Einschränkung verwenden, Sie könnten die Extended-Eigenschaft verwenden für jede Telefonnummer, die Sie für Businessnummer Verwendung zB suchen möchten versuchen wollen https://msdn.microsoft.com/en-us/microsoft-r/cc839937.aspx zB

 <m:Restriction> 
     <t:IsEqualTo> 
     <t:ExtendedFieldURI PropertyTag="14856" PropertyType="String" /> 
     <t:FieldURIOrConstant> 
      <t:Constant Value="9999-9999-999" /> 
     </t:FieldURIOrConstant> 
     </t:IsEqualTo> 
    </m:Restriction> 
+0

Dank @Glen das hat wirklich funktioniert! –