[英]Currency field is set to 0.00 when creating record in Dynamics CRM 2011 with SOAP endpoint
我正在嘗試向我的Microsoft Dynamics crm發送XML SOAP請求。 記錄已創建,但是由於某種原因,我的貨幣字段設置為0.00,而不是我提供的值。 我已經將SOAPlogger與sdk一起使用,以確保請求相同,並且在使用C#執行時正確設置了貨幣字段,但是當我嘗試使用PHP發出請求時,這些字段設置不正確。
以下是正在發送的創建請求。
<Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
<a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<a:KeyValuePairOfstringanyType>
<b:key>new_invoiceddate</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:dateTime">2014-07-31T00:00:00Z</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissiondate</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:dateTime">2014-10-01T00:00:00Z</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissionamount</b:key>
<b:value i:type="a:Money">
<a:value>28.08</a:value>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_carrier</b:key>
<b:value i:type="a:EntityReference">
<a:Id>9713bd59-5bca-e211-bd6d-001b21a73d70</a:Id>
<a:LogicalName>new_carrier</a:LogicalName>
<a:Name i:nil="true"/>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_usagebilled</b:key>
<b:value i:type="a:Money">
<a:value>140.40</a:value>
</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_name</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:string">Action Water Sports - 10/01/2014</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_invoicenumber</b:key>
<b:value xmlns:c="http://www.w3.org/2001/XMLSchema" i:type="c:string">142125103</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>new_commissiontype</b:key>
<b:value xmlns:c="http://schemas.microsoft.com/xrm/2011/Contracts" i:type="a:OptionSetValue">
<a:Value>100000000</a:Value>
</b:value>
</a:KeyValuePairOfstringanyType>
</a:Attributes>
<a:EntityState i:nil="true"/>
<a:FormattedValues xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
<a:Id>00000000-0000-0000-0000-000000000000</a:Id>
<a:LogicalName>new_carriercommission</a:LogicalName>
<a:RelatedEntities xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
</entity>
</Create>
由於某些原因,某些節點的名稱全為小寫,而其他節點的名稱均為大寫(Microsoft怪異的不一致之一),因此當嵌套在另一個稱為“值”的節點中時,“值”節點似乎應為“值”,例如:
<a:KeyValuePairOfstringanyType>
<b:key>new_commissionamount</b:key>
<b:value i:type="a:Money">
<a:value>28.08</a:value>
</b:value>
</a:KeyValuePairOfstringanyType>
實際上應該是:
<a:KeyValuePairOfstringanyType>
<b:key>new_commissionamount</b:key>
<b:value i:type="a:Money">
<a:Value>28.08</a:Value>
</b:value>
</a:KeyValuePairOfstringanyType>
注意在此示例中,“ b:value”如何保持全部小寫。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.