【问题标题】:How to get data or retrieve data from Microsoft Dynamics CRM 2015 through SOAPui如何通过 SOAPui 从 Microsoft Dynamics CRM 2015 获取数据或检索数据
【发布时间】:2015-09-24 05:02:06
【问题描述】:

我知道这可能是重复的问题,但在 2015 版本中,我在获取数据时遇到了一些问题。

我已阅读所有与此主题相关的博客,但未能成功。

我已按照以下步骤获取数据。

  1. 从 http://{server}/{OrgName}/XRMServices/2011/Organization.svc 在 SOAPui 中加载项目
  2. 编辑端点,在 Organisation.svc 之后添加 /web
  3. 添加了身份验证。 (用户名、密码、域)
  4. 添加了内容类型、SOAPAction、Accept

我仍然收到 Bad-Request 错误。

请帮忙。如果可能,请提供一些请求样品。

谢谢。

【问题讨论】:

  • 您是否在soapui 请求编辑器中验证了请求?另请参阅原始请求以查找已发送的所有详细信息。并转到首选项以包含传出请求的安全详细信息。

标签: c# dynamics-crm soapui microsoft-dynamics dynamics-crm-2015


【解决方案1】:

以下是设置请求的方法,请确保设置正确:

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

  2. 为您需要做的事情创建一个新请求

  3. 在请求中,将Authentication 设置为NTLM(提供凭据)

  4. 在请求中,您将需要三个这样的Headers(如果您已经拥有它们,请仔细检查它们):

    4.1。 SOAPAction - 从请求接口属性中复制/粘贴它

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

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

  5. 提供格式良好的请求并继续

例如,这是 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>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2023-03-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-25
  • 1970-01-01
相关资源
最近更新 更多