title: How does SoapUI bypass CORS issue when my ajax call can't do it?
body: <p>This might be a silly question but here is my simple webapi 2 method</p>
  
  <pre><code>public class ProductsController : ApiController
      {
          Product[] products = new Product[] 
          { 
              new Product { Id = 1, Name = "Tomato Soup", Category = "Groceries", Price = 1 }, 
              new Product { Id = 2, Name = "Yo-yo", Category = "Toys", Price = 3.75M }, 
              new Product { Id = 3, Name = "Hammer", Category = "Hardware", Price = 16.99M } 
          };
  
          public IEnumerable&lt;Product&gt; GetAllProducts()
          {
              return products;
          }
  </code></pre>
  
  <p>Now if I run it , on my pc it runs on <code>http://localhost:3145/Products</code>, and I can see the products as XML</p>
  
  <p>It also works using soapui</p>
  
  <p><img src="https://i.stack.imgur.com/ErQlr.png" alt="enter image description here"></p>
  
  <p>But now if I try to access this with a html file and this javascript </p>
  
  <pre><code>      &lt;script type="text/javascript"&gt;
              function GetProducts() {
  
  
                  $.ajax({
                      url: "http://localhost:3145/Products",
                      dataType: "json",
                      success: function (data) {
                          for (var i = 0; i &lt; data.length; i++)
                              $('#myDiv').append(data[i].Category).append("&lt;br/&gt;");
                      },
                      error: function (xhr, status) {
                          alert(xhr);
                      }
                  });
              }
  
          &lt;/script&gt;
      &lt;/head&gt;
  &lt;body onload="GetProducts()"&gt;
      &lt;h1&gt;My App&lt;/h1&gt;
      &lt;div id="myDiv"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I get the CORS error</p>
  
  <p><img src="https://i.stack.imgur.com/806zK.png" alt="enter image description here"></p>
  
  <p>How is SOAP UI not getting an error here when it is using http as well?</p>
  
  <p>Thanks</p>