Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what's the best way to call a external web service(with input) with javascript from CRM,

7 views
Skip to first unread message

ghazi bannour

unread,
Oct 24, 2017, 12:24:32 PM10/24/17
to
i tried several method but no result, i try this exempl but there are many error like:
SEC7120: Origin http://lon-srv:5555 not found in Access-Control-Allow-Origin header.
XMLHttpRequest: Network Error 0x80070005, Access is denied.



function getMessage()
{
var xmlHTTP;
if (window.XMLHttpRequest) {
xmlHTTP = new window.XMLHttpRequest;
}
else {
try {
xmlHTTP = new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch (ex) {
}
}
xmlHTTP.open("POST", "http://localhost/SayHelloUser/HelloUser.asmx",true);
xmlHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHTTP.setRequestHeader("SOAPAction", "http://tempuri.org/HelloWorld");
strRequest = "<?xml version='1.0' encoding='utf-8'?>";
strRequest = strRequest + "<soap:Envelope " +
"xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " +
"xmlns:xsd='http://www.w3.org/2001/XMLSchema' " +
"xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>";
strRequest = strRequest + " <soap:Body>";
strRequest = strRequest + "<HelloWorld xmlns='http://tempuri.org/'><name>ghazi</name></HelloWorld>";
strRequest = strRequest + "</soap:Body>";
strRequest = strRequest + "</soap:Envelope>";
xmlHTTP.onreadystatechange = function () {
if (xmlHTTP.readyState == 4 && xmlHTTP.status == 200) {
alert(xmlHTTP.responseXML.xml);
}
}
xmlHTTP.send(strRequest);
0 new messages