title: SCRIPT5022: InvalidAccessError xmlhttprequest
body: <p>I'm having a problem with my javaScript when I try to send GET. With <code>xmlhttprequest</code> I don't reach the WebServices, but I can reach it with Soap UI. </p>
  
  <p>The error code in mode debug in IE11 is :</p>
  
  <blockquote>
    <p>SCRIPT5022: InvalidAccessError</p>
  </blockquote>
  
  <p>The code is the following:</p>
  
  <pre><code>var xmlToSend = "&lt;?xml version='1.0' encoding='utf-8'?&gt;";
  xmlToSend += "&lt;soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:ws='some xmlns'&gt;";
  xmlToSend += "&lt;soap:Header/&gt; ";
  xmlToSend += "&lt;soap:Body&gt;";
  xmlToSend += "&lt;ws:searchMultisPolicy&gt;";
  xmlToSend += "&lt;ws:xmlRequest&gt;";
  xmlToSend += "&lt;![CDATA[";
  xmlToSend += "&lt;searchMultisPolicyReq&gt;";
  xmlToSend += "&lt;wsHeader&gt;";
  xmlToSend += "&lt;user&gt;B12345674280010001&lt;/user&gt;";
  xmlToSend += "&lt;logginDate&gt;27/04/2015&lt;/logginDate&gt;";
  xmlToSend += "&lt;roles&gt;170&lt;/roles&gt;";
  xmlToSend += "&lt;/wsHeader&gt;";
  xmlToSend += "&lt;params&gt;";
  xmlToSend += "&lt;idProveedor&gt;02&lt;/idProveedor&gt;";
  xmlToSend += "&lt;nifTomador&gt;12341234D&lt;/nifTomador&gt;";
  xmlToSend += "&lt;fechaOcurrencia&gt;2015-04-27T10:00:00&lt;/fechaOcurrencia&gt;";
  xmlToSend += "&lt;poliza&gt;80208813&lt;/poliza&gt;";
  xmlToSend += "&lt;razonSocial&gt;&lt;/razonSocial&gt;";
  xmlToSend += "&lt;/params&gt;";
  xmlToSend += "&lt;/searchMultisPolicyReq&gt;";
  xmlToSend += "]]&gt;";
  xmlToSend += "&lt;/ws:xmlRequest&gt;";
  xmlToSend += "&lt;/ws:searchMultisPolicy&gt;";
  xmlToSend += "&lt;/soap:Body&gt;";
  xmlToSend += "&lt;/soap:Envelope&gt;";
  
  var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
  xmldoc.loadXML(xmlToSend);
  xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = state_Change;
  xmlhttp.open(
                  "POST",
                  "some WebService",
                  0, "user", "pwd");
  xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*');
  xmlhttp.setRequestHeader("action", "urn:searchMultisPolicy");
  xmlhttp.setRequestHeader("Content-Type", "application/soap+xml");
  xmlhttp.setRequestHeader("charset", "UTF-8");
  xmlhttp.setRequestHeader("Accept-Encoding", "application/soap+xml");
  xmlhttp.send(xmldoc);
  
  function state_Change() {
      if (xmlhttp.readyState == 4) {
          // if "OK"
          if (xmlhttp.status == 200) {
              alert("OK");
              var objResponse = document.getElementById("responseDiv");
              objResponse.innerText = xmlhttp.responseXML.xml;
          } else {
              alert("Problema recibiendo XML"+" "+xmlhttp.status);
          }
      }
  }   
  </code></pre>