Click here to Skip to main content
Rate this: bad
good
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 asp.net 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 = "http://x.y.com:8082/abc.asmx";
            //var oDataEndpointUrl  = "http://x.y.com/abc/GetBillsFromRMSService";
            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", "https://x.y.com/xyz/GetBillsFromRMSService");
                xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
                xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
                xmlHttpRequest.send(xml);
                 alert("XML " +  xmlHttpRequest.responseXml);
                 
                }
 
            }
            return false;
        }
Posted 26-Sep-12 5:26am
Edited 4-Oct-12 2:37am
DaveAuld166.9K
v3

1 solution

Rate this: bad
good
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
  Permalink  

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

  Print Answers RSS
0 Schatak 394
1 OriginalGriff 300
2 Abhijit Ghosh (Subho) 125
3 _Amy 115
4 Andreas Gieriet 110
0 OriginalGriff 7,107
1 Sergey Alexandrovich Kryukov 5,623
2 Maciej Los 3,504
3 Peter Leow 3,373
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2014
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