Click here to Skip to main content
11,805,316 members (65,341 online)
Rate this: bad
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 5:26am
Edited 4-Oct-12 2: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
0 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 200
2 Richard Deeming 200
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2015
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