gpt4 book ai didi

php - 在线将选择列表值发送到 Dynamics crm 以使用 soap php 创建潜在客户

转载 作者:搜寻专家 更新时间:2023-10-31 21:47:45 25 4
gpt4 key购买 nike

我正在尝试使用 php 中的 soap 在 crm 365 在线创建潜在客户。我可以通过发送 soap 请求成功创建潜在客户,但我也想发送潜在客户来源,它是 crm 中的一个选择列表。这是我在 php 中的代码。不确定要使用哪种数据类型,int32 或 picklist,但两者都不起作用。

<b:KeyValuePairOfstringanyType>
<c:key>leadsourcecode</c:key>
<c:value i:type="d:OptionSetValue" xmlns:d="http://www.w3.org/2001/XMLSchema">100000010</c:value>
</b:KeyValuePairOfstringanyType>';

我收到这个错误:

Sendera:DeserializationFailedThe formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:entity. The InnerException message was 'Error in line 22 position 82. Element 'http://schemas.datacontract.org/2004/07/System.Collections.Generic:value' contains data from a type that maps to the name 'http://www.w3.org/2001/XMLSchema:OptionSetValue'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'OptionSetValue' and namespace 'http://www.w3.org/2001/XMLSchema'.'. Please see InnerException for more details.

最佳答案

您需要为内部值标签设置一个大写V。这是我用来更新状态原因的有效代码,请酌情修改。此外,SOAP 端点已弃用,您应该移至 WebAPI

request += "<a:KeyValuePairOfstringanyType>";
request += "<c:key>Status</c:key>";
request += "<c:value i:type=\"a:OptionSetValue\">";
request += "<a:Value>" + 2 + "</a:Value>";
request += "</c:value>";
request += "</a:KeyValuePairOfstringanyType>";

关于php - 在线将选择列表值发送到 Dynamics crm 以使用 soap php 创建潜在客户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53699882/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com