简体   繁体   English

CRM动态2011 XML缺少请求

[英]CRM dynamics 2011 XML missing request

I am facing a problem with my XML request, which is part of the web to CRM dynamics 2011 in order to create leads. 我的XML请求遇到了问题,这是CRM动态2011网络的一部分,以便创建销售线索。

The code that i'm stuck in at the moment is as follows: 我目前停留的代码如下:

            <s:Body>
                <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
                <entity xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <b:Attributes xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
                        <b:KeyValuePairOfstringanyType>
                            <c:key>name</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">Name Test 1</c:value>
                            <c:key>E-mail</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">test@test.com</c:value>
                        </b:KeyValuePairOfstringanyType>
                    </b:Attributes>
                    <b:EntityState i:nil="true"/>
                    <b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                    <b:Id>00000000-0000-0000-0000-000000000000</b:Id>
                    <b:LogicalName>account</b:LogicalName>
                    <b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                </entity>
                </Create>
            </s:Body>

The name is already available from within the code that I found, I tried to add the Email attribute (even Address) but nothing in the CRM other than the name, what exactly is the error in the code? 在我找到的代码中已经可以使用该名称,我尝试添加Email属性(甚至是地址),但是CRM中除了名称之外什么都没有,代码中的错误到底是什么? how should it be fixed? 应该如何解决?

Any help is appreciated and thank you everyone in advance. 感谢您的帮助,并在此先感谢大家。

I believe you need to use the logical names of the attributes instead of the display name (emailaddress1 instead of E-mail). 我相信您需要使用属性的逻辑名而不是显示名(用emailaddress1代替E-mail)。 Also I believe you need to have a KeyValuePair node for each attribute you want to send since it is an array of attributes you are sending. 另外,我相信您要为每个要发送的属性都拥有一个KeyValuePair节点,因为它是要发送的属性数组。 Try this out instead: 尝试以下方法:

<b:KeyValuePairOfstringanyType>
    <c:key>name</c:key>
    <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">Name Test 1</c:value>
</b:KeyValuePairOfstringanyType>
<b:KeyValuePairOfstringanyType>
    <c:key>emailaddress1</c:key>
    <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">test@test.com</c:value>
</b:KeyValuePairOfstringanyType>

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

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