title: I am trying to consume a webservice through jquery but it throws this error No 'Access-Control-Allow-Origin'
body: <p>I am trying to consume a webservice through jquery but it throws this error:</p>
  
  <blockquote>
    <p>No 'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin 'null' is therefore not allowed access. The response
    had HTTP status code 500.</p>
  </blockquote>
  
  <p>I read that it's related about "cross domain" but I can't resolve it. </p>
  
  <p>My code looks like this: </p>
  
  <pre><code>    &lt;script src="js/jquery.soap.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
  
  
          console.log("Entering processPeticion...");    
  
          // OBTENGO EL BARRIO A PARTIR DE LATITUD Y LONGITUD             
          var wsUrl = "http://gisdesa.mardelplata.gob.ar/opendata/ws.php/latlong_barrio";
  
          var soapRequest =
              '&lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:open="http://192.168.0.235/opendata"&gt;&lt;soapenv:Header/&gt;&lt;soapenv:Body&gt;&lt;open:latlong_barrio soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;latitud xsi:type="xsd:string"&gt;-38.001095&lt;/latitud&gt;&lt;longitud xsi:type="xsd:string"&gt;-57.551533&lt;/longitud&gt;&lt;token xsi:type="xsd:string"&gt;wwfe345gQ3ed5T67g4Dase45F6fer&lt;/token&gt;&lt;/open:latlong_barrio&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) {
  
  
              console.log("Entering processPeticion.success()...");
  
              var barrioCodigo;
              var barrioDescripcion;
  
              var myObj = new Array();
  
              if (status == "success"){
  
                  barrioCodigo = $(req.responseXML)
                  .find("latlong_barrioResponse")
                  .find("return")
                  .find("codigo").text();
                  console.log(barrioCodigo);    
  
                  barrioDescripcion = $(req.responseXML)
                  .find("latlong_barrioResponse")
                  .find("return")
                  .find("descripcion").text();
                  console.log(barrioDescripcion);                        
  
              }
  
          }
  
          function processError(data, status, req) {        
  
              console.log("Entering processPeticion.processError()...");
  
          }                 
  
      &lt;/script&gt;
  </code></pre>
  
  <p>Any help?</p>