none
Getting phone numbers using FindPeople in EWS RRS feed

  • Question

  • Hello,

    I'm trying to get phone numbers from contacts from an AdressList using a SOAP request in C++.  I can get contacts using this request :

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
     xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    	<soap:Header>
    		<t:RequestServerVersion Version="Exchange2013" />
    	</soap:Header>
    	<soap:Body>
    		<m:FindPeople>
    			<m:PersonaShape>
    				<t:BaseShape>Default</t:BaseShape>
    				<t:AdditionalProperties>
    					<t:FieldURI FieldURI="persona:EmailAddress"/>
    				</t:AdditionalProperties>
    			</m:PersonaShape>;
    			<m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="5" Offset="0"/>
    			<m:ParentFolderId>
    				<t:AddressListId Id="xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/>
    			</m:ParentFolderId>
    		</m:FindPeople>
    	</soap:Body>
    </soap:Envelope>

    but this resquest fail:

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
     xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    	<soap:Header>
    		<t:RequestServerVersion Version="Exchange2013" />
    	</soap:Header>
    	<soap:Body>
    		<m:FindPeople>
    			<m:PersonaShape>
    				<t:BaseShape>Default</t:BaseShape>
    				<t:AdditionalProperties>
    					<t:FieldURI FieldURI="persona:EmailAddress"/>
                                            <t:FieldURI FieldURI="persona:PhoneNumber"/>
    				</t:AdditionalProperties>
    			</m:PersonaShape>
    			<m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="5" Offset="0"/>
    			<m:ParentFolderId>
    				<t:AddressListId Id="xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/>
    			</m:ParentFolderId>
    		</m:FindPeople>
    	</soap:Body>
    </soap:Envelope>

    response :

    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Header>
          <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1130" MinorBuildNumber="6" Version="V2_23" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
       </s:Header>
       <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <FindPeopleResponse ResponseClass="Error" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
             <MessageText>Invalid shape specification</MessageText>
             <ResponseCode>ErrorInvalidArgument</ResponseCode>
             <DescriptiveLinkKey>0</DescriptiveLinkKey>
             <TotalNumberOfPeopleInView>0</TotalNumberOfPeopleInView>
             <FirstMatchingRowIndex>0</FirstMatchingRowIndex>
             <FirstLoadedRowIndex>0</FirstLoadedRowIndex>
          </FindPeopleResponse>
       </s:Body>
    </s:Envelope>

    I can't find the right additional properties.

    Tuesday, March 8, 2016 11:05 AM

Answers