简体   繁体   中英

How to get data or retrieve data from Microsoft Dynamics CRM 2015 through SOAPui

I know it may be duplicate question, but in 2015 release I am facing some issue while getting data.

I have read all blogs related to this subject, but could not make it.

I have followed below steps to get data.

  1. Loaded project in SOAPui from http://{server}/{OrgName}/XRMServices/2011/Organization.svc
  2. Edited endpoint, Added /web after Organisation.svc
  3. Added Authentication. (username,password,domain)
  4. Added content-type, SOAPAction, Accept

Still I am getting Bad-Request error.

please help. If possible please give some Request sample.

Thanks.

Here's how to setup requests, make sure you're setup correctly:

  1. Create a SOAP project pointing to http://<organization url>/XrmServices/2011/Organization.svc?wsdl (you'll have to authenticate)

  2. Create a new request for w/e you need to do

  3. In the request, set Authentication to NTLM (provide credentials)

  4. In the request, you'll need three Headers like this (double-check them if you already have them there):

    4.1. SOAPAction - copy/paste it from the request interface properties

    4.2 Accept - application/xml, text/xml, */*

    4.3 Content-Type - text/xml; charset=utf-8 text/xml; charset=utf-8

  5. Provide a well-formed request and go

For example, this is what a RetrieveEntityRequest looks like (this in particular will return the metadata of the account entity):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><a:SdkClientVersion xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">6.0</a:SdkClientVersion></soapenv:Header>
<soapenv:Body>
 <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <request i:type="a:RetrieveEntityRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
   <a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <a:KeyValuePairOfstringanyType>
     <b:key>EntityFilters</b:key>
     <b:value i:type="c:EntityFilters" xmlns:c="http://schemas.microsoft.com/xrm/2011/Metadata">Attributes</b:value>
    </a:KeyValuePairOfstringanyType>
    <a:KeyValuePairOfstringanyType>
     <b:key>MetadataId</b:key>
     <b:value i:type="ser:guid"  xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-000000000000</b:value>
    </a:KeyValuePairOfstringanyType>
    <a:KeyValuePairOfstringanyType>
     <b:key>RetrieveAsIfPublished</b:key>
     <b:value i:type="c:boolean" xmlns:c="http://www.w3.org/2001/XMLSchema">true</b:value>
    </a:KeyValuePairOfstringanyType>
    <a:KeyValuePairOfstringanyType>
     <b:key>LogicalName</b:key>
       <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">account</b:value>
    </a:KeyValuePairOfstringanyType>
   </a:Parameters>
   <a:RequestId i:nil="true" />
   <a:RequestName>RetrieveEntity</a:RequestName>
  </request>
 </Execute>
</soapenv:Body>
</soapenv:Envelope>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM