Показать сообщение отдельно
Старый 09.08.2012, 11:09   #16  
mistah is offline
mistah
Участник
 
169 / 13 (1) ++
Регистрация: 11.11.2011
Адрес: Коньково
Цитата:
как Вы положили aspx в веб-ресуры?
Ресурс это скрипт, стиль html, страница .. aspx там нет
нет, я веб-ресурс и вызываю же)

с этим я разобрался, но теперь следующая проблема:

я из ресурса пытаюсь soap-запросом получить данные и получаю ошибку. с формы любой сущности запрос отрабатывает, как надо.

подскажите, пожалуйста, в чем дело может быть?

функция из html-ресурса, ей я передаю id, хочу получить атрибут сущности с этим id

X++:
  function parsedatabyid(id)
{
alert(id);
var mass = document.createElement("p");
mass.innerText = id;
document.body.appendChild(mass);
//var CrmURL = "http://" + document.location.hostname + ":" + document.location.port;
//alert(CrmUrl);

//var authenticationHeader = GenerateAuthenticationHeader();
// Prepare the SOAP message.
var xml = "<?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:Body>"+ 
"<Retrieve xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+ 
"<entityName>new_pp321</entityName>"+ 
"<id>"+id+"</id>"+ 
"<columnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'>"+ 
"<q1:Attributes>"+ 
"<q1:Attribute>new_name</q1:Attribute>"+ 
"</q1:Attributes>"+ 
"</columnSet>"+ 
"</Retrieve>"+ 
"</soap:Body>"+ 
"</soap:Envelope>";
// Prepare the xmlHttpObject and send the request.
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("POST", "http://vccrm-1.xxx:8888/mscrmservices/2007/CrmService.asmx", false);
xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xHReq.setRequestHeader("Content-Length", xml.length);
xHReq.send(xml);
// Capture the result.
var resultXml = xHReq.responseXML;
// Check for errors.
var errorCount = resultXml.selectNodes('//error').length;
if (errorCount != 0)
{
 var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
 alert(msg +"e");
}
// Display the retrieved value.
else
{
resu = resultXml.selectSingleNode("//q1:new_name").nodeTypedValue;
alert(resu);
}
}

ошибка вылетает на строке xHReq.send(xml);
Изображения