Estou com um problema no serviço de cancelamento de nf-e em homologação. O problema só acontece com o estado do Ceará:
(297) Rejeicao: Assinatura difere do calculado
Fiz validação do XML no site da Sefaz do CE e está ok:
* Leiaute: cancNFe Versão: 2.00
* Estrutura válida.
* Assinatura Válida.
* Codificação UTF-8.
Segue arquivo xml de requisição do cancelamento:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><cancNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00"><infCanc Id="ID23110607071009000213550010000254631100604776"><tpAmb>2</tpAmb><xServ>CANCELAR</xServ><chNFe>23110607071009000213550010000254631100604776</chNFe><nProt>123110000326494</nProt><xJust>TESTECANCELAMENTONFE</xJust></infCanc><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#ID23110607071009000213550010000254631100604776"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>ihO7CEV/LOjFU0CZOnRT77Hj5nM=</DigestValue></Reference></SignedInfo><SignatureValue>cXGtzxwrlA9AZMrO6tF6l3DGdjV+/Aas+iOwrJkjuZEypjjqesBwu/fbw6MywL+FNdi2l05B5lKD
tKL2BCmyaoO70z16lwFuZFVeGSUx3RPLyElVJAyMg1r0JHe7ec4tSvfhJh6U4U8L++97CYc3qKQC
NPDkUgtf1Tp/i5NZhJs=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIGYjCCBUqgAwIBAgIIWBqPPQ+GJYAwDQYJKoZIhvcNAQEFBQAwdTELMAkGA1UEBhMCQlIxEzAR
BgNVBAoTCklDUC1CcmFzaWwxNjA0BgNVBAsTLVNlY3JldGFyaWEgZGEgUmVj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da requisição:
Este é o código java de envio:
hservice = new NfeCancelamento2Stub(endereco);
NfeCancelamento2Stub.NfeCabecMsg nfeCabecMsg = new NfeCancelamento2Stub.NfeCabecMsg();
nfeCabecMsg.setVersaoDados(versaoDados);
nfeCabecMsg.setCUF(codUF.toString());
NfeCancelamento2Stub.NfeCabecMsgE nfeCabecMsgE = new NfeCancelamento2Stub.NfeCabecMsgE();
nfeCabecMsgE.setNfeCabecMsg(nfeCabecMsg);
InputStream in = new FileInputStream(dirDadosMsg);
//Nova linha devido ao erro de namespace
XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
//Nova linha devido ao erro de namespace
//Propriedade utilizada para manter o namespace <NFe xmlns="www.portalfiscal.inf.br/nfe" >
xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.FALSE);
//Nova linha devido ao erro de namespace
XMLStreamReader xmlReader = xmlInputFactory.createXMLStreamReader(in);
StAXOMBuilder staxOMBuilder = new StAXOMBuilder(xmlReader);
NfeCancelamento2Stub.NfeCancelamentoNF2Result nfeCancelamento2Result = new NfeCancelamento2Stub.NfeCancelamentoNF2Result();
NfeCancelamento2Stub.NfeDadosMsg nfeDadosMsg = new NfeCancelamento2Stub.NfeDadosMsg();
nfeDadosMsg.setExtraElement(staxOMBuilder.getDocumentElement());
nfeCancelamento2Result = hservice.nfeCancelamentoNF2(nfeDadosMsg, nfeCabecMsgE);
BufferedWriter out = new BufferedWriter(new FileWriter(dirArqRetorno));
retMsgME = nfeCancelamento2Result.getExtraElement().toString();
out.write(retMsgME);
out.close();
Utilizei o web service do estado do RS para geração dos arquivos NfeCancelamento2Stub.java e NfeCancelamento2CallbackHandler.java
Muito obrigado pela atenção.