web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

2013 CRM online - raw SOAP XML examples?

(0) ShareShare
ReportReport
Posted on by 210

hello,

i am working on a non-.NET, non-javascript, external application, that is connecting to an instance of dynamics online 2013 via SOAP.  

i can make some basic requests (get a single entity, get multiple entities), but am struggling to fetch more complex data from the CRM.  does anyone know of examples of the raw SOAP XML required to run various queries?  

things like:

  • get all contacts along with their notes.
  • get all accounts along with multiple custom relationship (1:N) values

furthermore, can some confirm that it is possible to use the fetchXML syntax within SOAP for the version of ms dynamics i am working with (2013 online)?

thanks.

*This post is locked for comments

I have the same question (0)
  • jpaxon Profile Picture
    210 on at

    additionally, is it possible via a SOAP call to run a report created and saved in the CRM web interface?

  • Royal King Profile Picture
    27,686 on at

    Yes you can execute Fetchxml queies using SOAP API.

    Best place to find  all the API messages and  sample code is CRM SDK . If you need more sample check the below blog it has lots of sample c# code to query CRM using SOAP API as well REST API

    mileyja.blogspot.com/.../how-to-retrieve-metadata-for-entity.html

  • Suggested answer
    Alessandro Graps Profile Picture
    2,664 on at
  • jpaxon Profile Picture
    210 on at

    thanks all.

    as i already have a successful connection to the CRM, what i am looking for are examples of the actual SOAP XML for complex queries.  particularly around how to get 1 to many entity relationships.  XML examples of the following would help:

    1. how to get contacts along with their notes
    2. how to get contacts along with a custom 1 to many relationship
    3. how to execute reports that were created and saved via the web interface.

    thanks again.

  • Royal King Profile Picture
    27,686 on at

    You can build FetchXml Queries using Advanced find in crm to get whatever results you want.

  • Verified answer
    jpaxon Profile Picture
    210 on at

    thanks chitra, but not entirely true.  advanced find won't let you link to notes.  it does work for pretty much all the other relationships though.

    if anyone else lands here, this will get you notes: community.dynamics.com/.../100257.aspx

  • CPQExpert Profile Picture
    35 on at

    Do you have any RAW Soap Examples to login to Dynamics online ?

  • Suggested answer
    Criss69 Profile Picture
    20 on at

    Hello,

    I have put together a plain PHP program that queries an on-premise CRM and displays the query result in a simple way (non-XML). 

    The code I use to query contats is:

      <s:Body>
        <Execute xmlns="schemas.microsoft.com/.../Services" xmlns:i="www.w3.org/.../XMLSchema-instance">
          <request i:type="a:RetrieveMultipleRequest" xmlns:a="schemas.microsoft.com/.../Contracts">
            <a:Parameters xmlns:b="schemas.datacontract.org/.../System.Collections.Generic">
              <a:KeyValuePairOfstringanyType>
                <b:key>Query</b:key>
                <b:value i:type="a:QueryExpression">
                  <a:ColumnSet>
                    <a:AllColumns>false</a:AllColumns>
                    
                    <a:Columns xmlns:c="schemas.microsoft.com/.../Arrays">
                      <c:string>firstname</c:string>
                      <c:string>lastname</c:string>
                    </a:Columns>                
                  </a:ColumnSet>
    
                  <a:Distinct>false</a:Distinct>
                  <a:EntityName>contact</a:EntityName>
                  <a:LinkEntities />
                  <a:Orders />
                  <a:PageInfo>
                    <a:Count>0</a:Count>
                    <a:PageNumber>0</a:PageNumber>
                    <a:PagingCookie i:nil="true" />
                    <a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>
                  </a:PageInfo>
                  <a:NoLock>false</a:NoLock>
                </b:value>
              </a:KeyValuePairOfstringanyType>
            </a:Parameters>
            <a:RequestId i:nil="true" />
            <a:RequestName>RetrieveMultiple</a:RequestName>
          </request>
        </Execute>
      </s:Body>


    The program puts this code inside an evelope tag, and it works.

    I have found out that witha few tweaks you can change the query behaviour.

    I need some more examples to query Accounts, and some exhaustive guide on filters/operators would be really useful.

    I hope the above can help, anyway.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans