简体   繁体   English

如何通过SOAPui从Microsoft Dynamics CRM 2015获取数据或检索数据

[英]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. 我知道这可能是重复的问题,但是在2015年版本中,我在获取数据时遇到了一些问题。

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 从http:// {server} / {OrgName} /XRMServices/2011/Organization.svc在SOAPui中加载的项目
  2. Edited endpoint, Added /web after Organisation.svc 编辑端点,在Organisation.svc之后添加/ web
  3. Added Authentication. 添加了身份验证。 (username,password,domain) (用户名,密码,域)
  4. Added content-type, SOAPAction, Accept 添加了内容类型,SOAPAction,接受

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) 创建一个指向http://<organization url>/XrmServices/2011/Organization.svc?wsdl的SOAP项目(您必须进行身份验证)

  2. Create a new request for w/e you need to do 为需要创建的w / e创建新请求

  3. In the request, set Authentication to NTLM (provide credentials) 在请求中,将“ Authentication设置为NTLM (提供凭据)

  4. In the request, you'll need three Headers like this (double-check them if you already have them there): 在请求中,您将需要三个这样的Headers (如果已在其中,请仔细检查它们):

    4.1. 4.1。 SOAPAction - copy/paste it from the request interface properties SOAPAction从请求接口属性复制/粘贴它

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

    4.3 Content-Type - text/xml; charset=utf-8 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): 例如,这是RetrieveEntityRequest样子(特别是它将返回account实体的元数据):

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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