Невозможно вставить запись Dynamics CRM через запрос SOAP для типа данных Money

Я пытаюсь отправить запрос XML SOAP (приведенный ниже) в мою Microsoft Dynamics crm. Однако это бросает мне ошибку. Я понял, что это проходит, если я избегаю

<b:KeyValuePairOfstringanyType> <c:key>new_grantprojecttotalcost</c:key> <c:value i:type='a:Money'><b:Value>1234.00</b:Value></c:value> </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType> <c:key>new_grantprojectfundingrequired</c:key> <c:value i:type='a:Money'><b:Value>123.00</b:Value></c:value> </b:KeyValuePairOfstringanyType>

который имеет тип данных Money.
Полный запрос выглядит следующим образом

            <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
            xmlns:a="http://www.w3.org/2005/08/addressing"
            xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
              <s:Header>
                <a:Action s:mustUnderstand="1">
                http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Create</a:Action>
                <a:MessageID>
                urn:uuid:6511f419-3d6d-446f-852e-ffd1169d1d14</a:MessageID>
                <a:ReplyTo>
                  <a:Address>
                  http://www.w3.org/2005/08/addressing/anonymous</a:Address>
                </a:ReplyTo>
                <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">
                uIDPozJEz+P/wJdOhoN2XNauvYcAAAAAK0Y6fOjvMEqbgs9ivCmFPaZlxcAnCJ1GiX+Rpi09nSYACQAA</VsDebuggerCausalityData>
                <a:To s:mustUnderstand="1">
                https://scy.crm4.dynamics.com/XRMServices/2011/Organization.svc</a:To>
                <o:Security s:mustUnderstand="1"
                xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                  <u:Timestamp u:Id="_0">
                    <u:Created>2013-09-19T05:27:01.35Z</u:Created>
                    <u:Expires>2013-09-19T05:32:01.35Z</u:Expires>
                  </u:Timestamp>
                  <EncryptedData Id="Assertion0"
                  Type="http://www.w3.org/2001/04/xmlenc#Element"
                  xmlns="http://www.w3.org/2001/04/xmlenc#">
                    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc">
                    </EncryptionMethod>
                    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                      <EncryptedKey>
                        <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
                        </EncryptionMethod>
                        <ds:KeyInfo Id="keyinfo">
                          <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

                            <wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
                            ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">
                            </wsse:KeyIdentifier>
                          </wsse:SecurityTokenReference>
                        </ds:KeyInfo>
                        <CipherData>
                          <CipherValue>
                          </CipherValue>
                        </CipherData>
                      </EncryptedKey>
                    </ds:KeyInfo>
                    <CipherData>
                      <CipherValue>
                      </CipherValue>
                    </CipherData>
                  </EncryptedData>
                </o:Security>
              </s:Header>
              <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>scy_name</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Business Grant Programme Application</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_fullname</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Aboo Tafadar4</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_jobtitle</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Iquara</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_accountname</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Iquara</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_emailaddress</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>[email protected]</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_contactphone</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>913642225808</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_addressline1</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Bivar Road</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_addressline2</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>aaaa</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_addressline3</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Iquara Ltd, Catalyst</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_city</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>York</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_postcode</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>yo103jy</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_registeredaddress1</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Iquara Ltd, Catalyst</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_registeredaddress2</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>University of York</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_registeredaddress3</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>Iquara Ltd, Catalyst</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_registeredcity</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>York</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_registeredpostcode</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>yo103jy</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_websiteurl</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>iquara</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_companynumber</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>1787686</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_yearstartedtrading</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>1980</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_description</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>hghghjg</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_grantprojectdescription</c:key>
        <c:value i:type='d:string' xmlns:d='http://www.w3.org/2001/XMLSchema'>khkkjh</c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_grantprojecttotalcost</c:key>
        <c:value i:type='a:Money'><b:Value>1234.00</b:Value></c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_grantprojectfundingrequired</c:key>
        <c:value i:type='a:Money'><b:Value>123.00</b:Value></c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>scy_leadsource</c:key>
        <c:value i:type='b:OptionSetValue'><b:Value>798110007</b:Value></c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_sendmarketinginfo</c:key>
        <c:value i:type='b:OptionSetValue'><b:Value>100000001</b:Value></c:value>
      </b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType>
        <c:key>new_grantprojecteligibility</c:key>
        <c:value i:type='b:OptionSetValue'><b:Value>100000000</b:Value></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>scy_webformrecord</b:LogicalName>
    <b:RelatedEntities xmlns:c='http://schemas.datacontract.org/2004/07/System.Collections.Generic'/>
  </entity>
</Create>
              </s:Body>
            </s:Envelope>

person Soyeed    schedule 19.09.2013    source источник
comment
Вы можете добавить ошибку к этой проблеме ?? Использовали ли вы регистратор SOAP Dynamics CRM? На первый взгляд ваш вызов SOAP выглядит правильно.   -  person Campey    schedule 19.09.2013
comment
Как использовать регистратор динамики SOAP   -  person Soyeed    schedule 19.09.2013
comment
Загрузите Dynamics CRM SDK и в папке samplecode\cs\client\soaplogger\soaplogger вы найдете приложение SOAP Logger. Затем вы сможете воссоздать описанную выше проблему, используя код C#, и вы сможете получить рабочий вызов SOAP в файле output.txt.   -  person Campey    schedule 19.09.2013


Ответы (1)


Глядя на ваш запрос, похоже, что ваше пространство имен неверно.

Попробуйте изменить их на «b:Money», а не на «a:Money».

       <b:KeyValuePairOfstringanyType>
          <c:key>new_grantprojecttotalcost</c:key>
          <c:value i:type="a:Money">
             <b:Value>1234.00</b:Value>
          </c:value>
       </b:KeyValuePairOfstringanyType>
       <b:KeyValuePairOfstringanyType>
          <c:key>new_grantprojectfundingrequired</c:key>
          <c:value i:type="a:Money">
             <b:Value>123.00</b:Value>
          </c:value>
       </b:KeyValuePairOfstringanyType>
person Campey    schedule 19.09.2013
comment
Большое спасибо .. это сделало это :) - person Soyeed; 19.09.2013
comment
Что, если то же самое для числа? - person Soyeed; 19.02.2014
comment
это мой целочисленный бит (целое число) ` ‹b:KeyValuePairOfstringanyType› ‹c:key›scy_numberofemployees‹/c:key› ‹c:value i:type='b:Integer'›‹b:Value›23‹/b :Value›‹/c:value› ‹/b:KeyValuePairOfstringanyType› ` - person Soyeed; 19.02.2014
comment
Для целого числа это должно быть целое, а не целое. Например: ‹a:keyvaluepairofstringanytype› ‹b:key›‹! -- ЗДЕСЬ ИДЕТ НАЗВАНИЕ СХЕМЫ КОЛОНЦЫ CRM!! --›‹/b:key› ‹b:значение i:type=c:int xmlns:c=w3.org/2001/XMLSchema›‹!-- ЗНАЧЕНИЕ АТРИБУТА ИДЕТ ЗДЕСЬ!! --›‹/b:value› ‹/a:keyvaluepairofstringanytype› - person Campey; 20.02.2014