Click here to Skip to main content
13,403,376 members (53,841 online)
Rate this:
Please Sign up or sign in to vote.
I'm currently facing an issue calling our own built webservice from mscrm form onload javascript event, all I get is a permission denied here is my javascript and more details, the same javascript code if I run it from a website I get my data back, I'm only getting the permissions denied error if I put this Jscript on MSCRM form. I tried with calling with a relative path like (x.y.z/WebService.asmx and /WebService.asmx)in that case I get a resource not found error. Your help is highly appreciated

function GetRMSBillDetails() {
           // var oDataEndpointUrl = "/WebService.asmx";

            var oDataEndpointUrl = "";
            //var oDataEndpointUrl  = "";
            var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");

            if (xmlHttpRequest != null) {

                var xml = "";
                xml += "";
                xml += "<soap:body xmlns:soap="#unknown">"
                xml += ""
                xml += "</soap:body>"
                xml += "";

                xmlHttpRequest.Open("POST", oDataEndpointUrl, true);
                xmlHttpRequest.setRequestHeader("SOAPAction", "");
                xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
                xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
                 alert("XML " +  xmlHttpRequest.responseXml);

            return false;
Posted 26-Sep-12 6:26am
Updated 4-Oct-12 3:37am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I have found the solution for the problem, just in case if anyone needs the solution here it is. MSCRM is running under https binding type and my webservice was running under http binding type port, so I had to go to IIS on which my webservice is hosted and had to change the binding settings for the web service to run under https not http and that fixed the problem. Basically MSCRM if running on HTTPS expect the code that is running under its domain to be run on HTTPS also

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.1802120.2 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100