How to insert Access-Control-Allow-Origin in the header

Asked

Viewed 3,648 times

5

Dear Friends, I am making an ajax request by JQuery.Ajax(), to consume a WS SOAP, the envelope is OK but when I make the call I get in the browser "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 403."

The server is a Tomcat 7, I read about it and changed the Web.xml that this in the conf folder any more of this resulted in success where I can put this information Access-Control-Allow-Origin Worth: *

Meu Ajax:

jQuery.support.cors = true;

 //console.log(soapMessage);

 var request = $.ajax({
        type: "POST",
        url: url ,
        data: soapMessage,            
        async: false,
        crossDomain: true,  
        contentType: "text/xml",  
        dataType: "xml"
      }).done(function( data,  textStatus, jqXHR ) {

         alert(data);

         var headline = $(data.responseText).text();
         $("#retorno").html(headline);

     });

1 answer

3

  • help us! Yes!!!!!!!!!! !!!

  • It was a success for me too!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.