Click here to Skip to main content
11,483,586 members (69,286 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 6:26am
Edited 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
0 Sergey Alexandrovich Kryukov 250
1 Frankie-C 175
2 Raje_ 155
3 OriginalGriff 152
4 Abhipal Singh 108
0 Sergey Alexandrovich Kryukov 8,489
1 OriginalGriff 7,943
2 Sascha Lefèvre 3,114
3 Maciej Los 2,581
4 Richard Deeming 2,370

Advertise | Privacy | Mobile
Web04 | 2.8.150520.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