locked
Update from CRM2011 to CRM2013 RRS feed

  • Question

  • Hi, In the follow code, I have the error

    "Web resource XXXX contains a reference to the 2007 web service endpoint"

    during the migration to CRM2013

    _Winvs.Common = {
        ExecuteRetrieveRequest: function (EntityName, EntityId, EntityColumns) {
            var resultXml, errorCount, msg, xmlHttpRequest, arrayEntityColumns, xmlEntityColumns;
    
            if (EntityColumns != undefined) {
                arrayEntityColumns = EntityColumns.split(",");
    
                for (var i = 0; i < arrayEntityColumns.length; i++) {
                    xmlEntityColumns += "<q1:Attribute>" + arrayEntityColumns[i] + "</q1:Attribute>";
                }
            }
    
            var authenticationHeader = _Winvs.Context.AuthenticationHeader;
    
            // Prepare the SOAP message. 
            var xml = "<?xml version='1.0' encoding='utf-8'?>" +
                    "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
                    " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
                    " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
                    authenticationHeader +
                    "<soap:Body>" +
                    "<Retrieve xmlns='http://schemas.microsoft.com/crm/2011/WebServices'>" +
                    "<entityName>" + EntityName + "</entityName>" +
                    "<id>" + EntityId + "</id>" +
                    "<columnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'>";
    
            if (_Winvs.Helpers.HasStringValue(xmlEntityColumns)) {
                xml = xml + "<q1:Attributes>" +
                            xmlEntityColumns +
                            "</q1:Attributes>";
            }
            else {
                xml = xml + "<q1:AllColumns>true</q1:AllColumns>";
            }
    
            xml = xml + "</columnSet>" +
                    "</Retrieve></soap:Body></soap:Envelope>";
    
            // create Request 
            xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
            xmlHttpRequest.Open("POST", "/mscrmservices/2011/CrmService.asmx", false);
            xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2011/WebServices/Retrieve");
            xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
            xmlHttpRequest.send(xml);
    
            // get Response
            resultXml = xmlHttpRequest.responseXML;
            var errorCount = resultXml.selectNodes('//error').length;
            if (errorCount != 0) {
                var msg = _Winvs.Helpers.ReadXmlNodeValue('description');
                alert("Error Message : " + msg);
            }
            else {
                return resultXml;
            }
        }

    Can you help me?


    Alessandro Graps

    Monday, July 21, 2014 10:00 AM

Answers

All replies