|
20.08.2009, 12:04 | #1 |
Консультант-джедай
|
ну это уже движок форума чего то нахимичил
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>"+ "<Fetch xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+ "<fetch mapping='logical'><entity name='equipment'><no-attrs/><link-entity name='new_equipment_contractdetail' from='equipmentid' to='equipmentid'/></entity></fetch>"+ "</Fetch>"+ "</soap:Body>"+ "</soap:Envelope>"; // Prepare the xmlHttpObject and send the request. var xHReq = new ActiveXObject("Msxml2.XMLHTTP"); xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false); xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Fetch"); 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 + "0"); } // Process and display the results. else { // Capture the result and UnEncode it. var resultSet = new String(); resultSet = resultXml.text; resultSet.replace('<','<'); resultSet.replace('>','>'); // Create an XML document that you can parse. var oXmlDoc = new ActiveXObject("Microsoft.XMLDOM"); oXmlDoc.async = false; // Load the XML document that has the UnEncoded results. oXmlDoc.loadXML(resultSet); // Display the results. var results = oXmlDoc.getElementsByTagName('result'); var msg = "\equipment Id\t\t\t\tequipment Name\r"; msg +="--------------------------------------------------------------------------------\r"; for (i=0;i < results.length;i++) { var idValue = results[i].selectSingleNode('./equipmentid').nodeTypedValue; msg += idValue +"\t"; alert(idValue); }
__________________
Крокодил, крокожу и буду крокодить. Человек человеку - волк , а зомби зомби - зомби. Экстремал и буду экстремать! Блога |
|
20.08.2009, 12:25 | #2 |
Участник
|
Так Ошибки на странице уже нет, но и результата тоже нет, тишина.
|
|