title: JQuery AJAX call to SOAP Web Service - Access denied. Working in SOAP UI
body: <p>JQuery AJAX call to SOAP Web Service throws exception as "Access denied". See screenshot. It is Working in SOAP UI so SOAP request seems correct. Please help in finding problem and fixing.</p>
  
  <p>My other code screenshot - <a href="http://tinypic.com/r/2liasgl/5" rel="nofollow">http://tinypic.com/r/2liasgl/5</a> </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;Calling Web Service from jQuery&lt;/title&gt;
      &lt;script type="text/javascript" src="jquery-1.9.1.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              jQuery.support.cors = true;
  
              $("#btnCallWebService").click(function (event) {
                  var wsUrl = "https://webservices..myservice.../";
                  var soapRequest = '&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:dictionary:com.myservice.webservices"&gt;&lt;soapenv:Header xmlns:wsse="http://myservice.org/wss/2004/01/myservice-1.0.xsd"&gt;&lt;wsse:Security soapenv:mustUnderstand="1"&gt;&lt;wsse:UsernameToken&gt;&lt;wsse:Username&gt;efhueeudedujed&lt;/wsse:Username&gt;&lt;wsse:Password Type="http://myservice-wss-username-token-profile-1.0#PasswordText"&gt;dfdjfhdkjfa&lt;/wsse:Password&gt;&lt;/wsse:UsernameToken&gt;&lt;/wsse:Security&gt;&lt;/soapenv:Header&gt;&lt;soapenv:Body&gt;&lt;urn:getETNInstances/&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;';
  
  
                  $.ajax({
                      type: "POST",
                      url: wsUrl,
                      contentType: "text/xml",
                      dataType: "xml",
                      data: soapRequest,
                      success: processSuccess,
                      error: processError
                  });
  
              });
          });
  
          function processSuccess(data, status, req) {
              if (status == "success")
                  $("#response").text($(req.responseXML).find("HelloResult").text());
          }
  
          function processError(data, status, req) {
              alert(req.responseText + " " + status);
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;
          Calling Web Services with jQuery/AJAX
      &lt;/h3&gt;
      Enter your name:
      &lt;input id="txtName" type="text" /&gt;
      &lt;input id="btnCallWebService" value="Call web service" type="button" /&gt;
      &lt;div id="response" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>