Microsoft Dynamics CRM SOAP“;“错误请求”;正在尝试检索选项集数据

Microsoft Dynamics CRM SOAP“;“错误请求”;正在尝试检索选项集数据,soap,dynamics-crm-2011,Soap,Dynamics Crm 2011,我正在尝试使用Microsoft Dynamics SOAP请求: XRMServices/2011/Organization.svc/web 提出以下要求: <Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"> <request i:type=\"a:retrieveOp

我正在尝试使用Microsoft Dynamics SOAP请求:

XRMServices/2011/Organization.svc/web

提出以下要求:

<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">
<request i:type=\"a:retrieveOptionSetRequest\" 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>Name</b:key>
            <b:value i:type=\"c:string\" xmlns:c=\"http://www.w3.org/2001/XMLSchema\">new_industry</b:value>
        </a:KeyValuePairOfstringanyType>
    </a:Parameters>
    <a:RequestId i:nil=\"true\" />
</request>
</Execute>

名称
新兴工业
但是,作为一个新手,我得到的唯一不好的是“不好的要求”! 任何帮助都会得到极大的回报


谢谢,您的请求有一些问题。首先,请求是'RetrieveOptionSetRequest'而不是'RetrieveOptionSetRequest'(它会告诉您这不存在!)

其次,您的请求行中缺少一个“\”

<request i:type=\"a:retrieveOptionSetRequest\" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts\">

应该是

<request i:type=\"a:RetrieveOptionSetRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\">

如果您解决了这两个问题,那么您将发现仍然无法获得所需的结果。 从Pedro Azevedo提到的网站上可以看到,您需要包括MetadataId和RetrieveAsIfPublished参数,否则您将无法得到结果(响应将使您知道这一点)。您需要在请求中包含RequestName

您的最终请求应该如下所示

<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">
<request i:type=\"a:RetrieveOptionSetRequest\" 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>MetadataId</b:key>
            <b:value i:type=\"c:guid\" xmlns:c=\"http://schemas.microsoft.com/2003/10/Serialization/\">00000000-0000-0000-0000-000000000000</b:value>
        </a:KeyValuePairOfstringanyType>
        <a:KeyValuePairOfstringanyType>
            <b:key>Name</b:key>
            <b:value i:type=\"c:string\" xmlns:c=\"http://www.w3.org/2001/XMLSchema\">new_industry</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\">false</b:value>
        </a:KeyValuePairOfstringanyType>
    </a:Parameters>
    <a:RequestId i:nil=\"true\" />
    <a:RequestName>RetrieveOptionSet</a:RequestName>
</request>
</Execute>

元数据ID
00000000-0000-0000-0000-000000000000
名称
新兴工业
检索已发表
假的
检索选择起始