I'm trying to make a web service call on AngularJS, however I'm getting the following error message in the browser console (I tested it in chrome and Firefox):
XMLHttpRequest can not load
No Access-Control-Allow-Origin header is present on the requested resource. Origin ' link ' is therefore not allowed access.
As far as I understand, soap
complained that I did not send the request headers. Actually the service requires headers as below, however I do not know how to pass them in the parameter of the post
call, I just sent the body
parameters of the request.
Header Parameters: User and Store:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
<soapenv:Header>
<v1:header>
<usuario>?</usuario>
<loja>?</loja>
</v1:header>
</soapenv:Header>
<soapenv:Body>
<v1:inImprimirFatura>
<tipo-fatura>?</tipo-fatura>
<numero-cpf>?</numero-cpf>
</v1:inImprimirFatura>
</soapenv:Body>
</soapenv:Envelope>
Service that makes the post call:
function GerarSegundaViaFaturaTotvsPDF()
{
var metodo = 'imprimirFatura';
var url = '
var param = {};
param.tipoFatura = "ATUAL";
param.CPF =
return $soap.post(url, metodo, {req: param});
}
How do I step the header parameters in a simple way without changing the structure of my code?