web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calling (Navision) Web service from javascript

(0) ShareShare
ReportReport
Posted on by 65

Hi all,

i have two CRM's. On one server is development company. On second live version.

Calling Nav Web service working on dev but on live xmlhttp.Send returning status 0.

I am calling CRM on both servers from my local browser (IE,Firefox) throught vpn. Problem is not in browser settings.

I tried write C# solution for call WS on live to i am sure thats is not problem in Nav WS. Its ok.

Have some from you some idea where can be problem?

Thank you very much for eny idea

Vlado

Script:

function InvokeNavWS(URL, method, nameSpace, returnTag, parameters) {
    var result = "";
    try {
        var request = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="' + SoapEnvelopeNS + '">' +
                          '<soap:Body>' +
                          '<' + method + ' xmlns="' + nameSpace + '">' +
                          parameters +
                          '</' + method + '>' +
                          '</soap:Body>' +
                          '</soap:Envelope>';

        var xmlhttp;
        if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else {// code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }

        xmlhttp.open('POST', URL, false);

        xmlhttp.setRequestHeader('Content-type', 'text/xml; charset="utf-8"');
        xmlhttp.setRequestHeader('Content-length', request.length);
        xmlhttp.setRequestHeader('SOAPAction', '"' + method + '"');

        // Setup event handler when readystate changes
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    var xmldoc = new ActiveXObject('Microsoft.XMLDOM');
                    xmldoc.async = 'false';
                    xmldoc.loadXML(xmlhttp.response);
                    result = xmldoc.text;
                }
            }
        }

        // Send request will return when event has fired with readyState 4
        xmlhttp.send(request);
    }
    catch (e) {
        result = "";
    }
    return result;
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Deepesh161 Profile Picture
    6,317 on at

    We called nav web service in custom workflow in an earlier implementation, works fine.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans