Имя: Пароль:
1C
1С v8
1с8 + MS CRM ошибка 80040203
0 evgenyivanov
 
05.12.14
11:21
Пробую связать 1С8 и MS CRM.

Отправляю xml

[CODE]
ТекстЗапроса = "<?xml version='1.0' encoding='utf-8'?>"+
"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'";+
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'";+
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'>";+
//authenticationHeader+
"<soap:Header>"+
    // Здесь у меня авторизация
"</soap:Header>"+  

///////////////////////////////////////
"<soap:Body>"+
"<RetrieveMultiple xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>";+
"<query xmlns:q1='http://schemas.microsoft.com/crm/2006/Query'";+
" xsi:type='q1:QueryExpression'>"+
"<q1:EntityName>new_region</q1:EntityName>"+
"<q1:ColumnSet xsi:type='q1:ColumnSet'>"+
"<q1:Attributes>"+
"<q1:Attribute>new_regionid</q1:Attribute>"+
"</q1:Attributes>"+
"</q1:ColumnSet>"+
"<q1:Distinct>false</q1:Distinct>"+
"<q1:Criteria>"+
"<q1:FilterOperator>And</q1:FilterOperator>"+
"<q1:Conditions>"+
"<q1:Condition>"+
"<q1:AttributeName>new_inn</q1:AttributeName>"+
"<q1:Operator>Equal</q1:Operator>"+
"<q1:Values>"+
"<q1:Value xsi:type='xsd:string'>"+ИНН+"</q1:Value>"+
"</q1:Values>"+
"</q1:Condition>"+
"</q1:Conditions>"+
"</q1:Criteria>"+
"</query>"+
"</RetrieveMultiple>"+
"</soap:Body>" +
"</soap:Envelope>";

    XMLHTTP=Новый COMОбъект("MSXML2.XMLHTTP");
    XMLHTTP.Open("POST", "........../MSCRMServices/2007/CrmService.asmx", false);
    XMLHTTP.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Update";);
    XMLHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    XMLHTTP.setRequestHeader("Content-Length", СтрДлина(ТекстЗапроса));
    Попытка
        XMLHTTP.send(ТекстЗапроса);
        
    исключение
        Результат = Результат+символ(10)+ "Не удалось отправить ";
    КонецПопытки;

[/CODE]

1. Авторизация проходит.
2. Программа возвращает ошибку

[CODE]<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><soap:Header><CrmAuthenticationToken xmlns='http://schemas.microsoft.com/crm/2007/WebServices'><AuthenticationType xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>0</AuthenticationType><CrmTicket xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>0</CrmTicket><OrganizationName xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>runov</OrganizationName><CallerId xmlns='http://schemas.microsoft.com/crm/2007/CoreTypes'>00000000-0000-0000-0000-000000000000</CallerId></CrmAuthenticationToken></soap:Header><soap:Body><RetrieveMultiple xmlns='http://schemas.microsoft.com/crm/2007/WebServices'><query xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:QueryExpression'><q1:EntityName>new_region</q1:EntityName><q1:ColumnSet xsi:type='q1:ColumnSet'><q1:Attributes><q1:Attribute>new_regionid</q1:Attribute></q1:Attributes></q1:ColumnSet><q1:Distinct>false</q1:Distinct><q1:Criteria><q1:FilterOperator>And</q1:FilterOperator><q1:Conditions><q1:Condition><q1:AttributeName>new_inn</q1:AttributeName><q1:Operator>Equal</q1:Operator><q1:Values><q1:Value xsi:type='xsd:string'>7713316507</q1:Value></q1:Values></q1:Condition></q1:Conditions></q1:Criteria></query></RetrieveMultiple></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request.</faultstring><detail><error>
  <code>0x80040203</code>
  <description>entity</description>
  <type>Platform</type>
</error></detail></soap:Fault></soap:Body></soap:Envelope>
[/CODE]

Включил трассировку

[CODE][2014-12-04 13:47:09.6] Process:CrmAsyncService |Organization:4730a932-504d-43dd-9afd-585eb1d144b0 |Thread:   61 |Category: Platform.Workflow
|User: 00000000-0000-0000-0000-000000000000 |Level: Error | WorkflowHost.OnWorkflowTerminated
>Workflow terminated: {0BF269DF-A27B-E411-AB99-0026181D291A} - Microsoft.Crm.Workflow.Activities.StopWorkflowException
   в Microsoft.Crm.Workflow.Activities.StopWorkflowActivity.Execute(ActivityExecutionContext executionContext)
   в System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   в System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   в System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   в System.Workflow.Runtime.Scheduler.Run()[/CODE]

Пробовал в запросе запрашивать не new_region, а account ошибка та же. Пробовал по другому тело запроса составить - та же ошибка.

Самое удивительное, что проблема только с fetch, update работает без сбоем