I'm trying to access the post office to calculate freight and I get the following msg:
Failed to load
http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx/CalcPrecoPrazo: No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://site.com' is therefore not allowed access.
My ajax:
var params = {
'nCdEmpresa': '',
'sDsSenha': '',
'nCdServico': '04014',
'sCepOrigem': '03638010',
'sCepDestino': '43810040',
'nVlPeso': '1',
'nCdFormato': '1',
'nVlComprimento': '16',
'nVlAltura': '5',
'nVlLargura': '15',
'nVlDiametro': '0',
'sCdMaoPropria': 'n',
'nVlValorDeclarado': '0',
'sCdAvisoRecebimento': 'n',
'StrRetorno': 'xml',
'nCdServico': '40010,41106'
};
$.ajax({
type: "POST",
url: "http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx/CalcPrecoPrazo",
data: params,
dataType : "xml",
success: function (data) {
console.log(JSON.stringify(data));
}
});