0
I am trying to perform a web service call on Angularjs, however I am getting the following error message on the browser console (tested on Chrome and Firefox):
Xmlhttprequest cannot load
No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://localhost:8083' is therefore not allowed access.
From what I understand soap
complained I didn’t send the order headers. Actually the service requires headers as below, however I do not know how to pass them in the call parameter post
, I just sent the parameters of body
of the requisition.
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 pass the header parameters in the call simply without changing the structure of my code?