Soap 用电话号码查询EWS

Soap 用电话号码查询EWS,soap,exchangewebservices,Soap,Exchangewebservices,我想使用电话号码查找联系人。我试过FindItem肥皂,但由于某种原因无法使用。我试着做如下的事情: <?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

我想使用电话号码查找联系人。我试过FindItem肥皂,但由于某种原因无法使用。我试着做如下的事情:

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

但是我得到一个属性不能用于这种类型的限制错误。有什么想法吗?

您不能在限制中使用该强类型属性,您可能希望尝试对要搜索的每个电话号码使用扩展属性,例如查找业务电话号码使用

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