Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How do i get contact entity data using soap envelop

Posted on by Microsoft Employee

How do i get contact entity data using soap envelop

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do i get contact entity data using soap envelop

    Thanks for prompt reply, i think this should work

  • Suggested answer
    sandeepstw Profile Picture
    sandeepstw 4,601 on at
    RE: How do i get contact entity data using soap envelop

    Hi,

    Use this soap request envelop:

    $xml ="<s:Body>";

       $xml .="<Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";

       $xml .="<request i:type=\"a:RetrieveMultipleRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\">";

       $xml .="<a:Parameters xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\">";

       $xml .="<a:KeyValuePairOfstringanyType>";

               $xml .="<b:key>Query</b:key>";

               $xml .="<b:value i:type=\"a:QueryExpression\">";

                 $xml .="<a:ColumnSet>";

                   $xml .="<a:AllColumns>true</a:AllColumns>";

                   $xml .="<a:Columns xmlns:c=\"schemas.microsoft.com/.../Arrays\">";

    //  $xml .="<c:string>query</c:string>";

                    // $xml .="<c:string>membertype</c:string>";

                   $xml .="</a:Columns>";                

                 $xml .="</a:ColumnSet>";

    $xml .= "<a:Criteria>";

                 $xml .= "<a:Conditions>";

                  $xml .= "<a:ConditionExpression>";

                  $xml .= "<a:AttributeName>contactid</a:AttributeName>";

                  $xml .= "<a:Operator>Equal</a:Operator>";

                  $xml .= "<a:Values xmlns:c=\"schemas.microsoft.com/.../Arrays\">";

                  $xml .= "<c:anyType i:type=\"d:string\" xmlns:d=\"www.w3.org/.../XMLSchema\">".$contactid."</c:anyType>";

                  $xml .= "</a:Values>";

                  $xml .= "</a:ConditionExpression>";

                 $xml .= "</a:Conditions>";

                  $xml .= "<a:FilterOperator>And</a:FilterOperator>";

                  $xml .= "<a:Filters />";

                  $xml .= "</a:Criteria>";

                 $xml .="<a:Distinct>false</a:Distinct>";

                 $xml .="<a:EntityName>contact</a:EntityName>";

                 $xml .="<a:LinkEntities />";

                 $xml .="<a:Orders />";

                 $xml .="<a:PageInfo>";

                   $xml .="<a:Count>0</a:Count>";

                   $xml .="<a:PageNumber>0</a:PageNumber>";

                   $xml .="<a:PagingCookie i:nil=\"true\" />";

                   $xml .="<a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>";

                 $xml .="</a:PageInfo>";

                 $xml .="<a:NoLock>false</a:NoLock>";

               $xml .="</b:value>";

             $xml .="</a:KeyValuePairOfstringanyType>";

           $xml .="</a:Parameters>";

           $xml .="<a:RequestId i:nil=\"true\" />";

           $xml .="<a:RequestName>RetrieveMultiple</a:RequestName>";

         $xml .="</request>";

       $xml .="</Execute>";

     $xml .="</s:Body>";

    Thanks,

    Sandeep

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans