DeGuedes
Segue o código
String msg =
"<nfeDadosMsg xmlns:ns1=\"http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetRecepcao2\">"
+ "<consReciNFe xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\">"
+ "<tpAmb>2</tpAmb>"
+ "<nRec>431000005381935</nRec>"
+ "</consReciNFe>"
+ "</nfeDadosMsg>";
try {
NfeRetRecepcao2Stub stub = new NfeRetRecepcao2Stub();
NfeRetRecepcao2Stub.NfeCabecMsg nfeCabec = new NfeRetRecepcao2Stub.NfeCabecMsg();
nfeCabec.setCUF("43");
nfeCabec.setVersaoDados("2.00");
NfeRetRecepcao2Stub.NfeCabecMsgE cabecMsgE = new NfeRetRecepcao2Stub.NfeCabecMsgE();
cabecMsgE.setNfeCabecMsg(nfeCabec);
XMLStreamReader dadosXML = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(msg));
NfeRetRecepcao2Stub.NfeDadosMsg nfeDadosMsg = NfeRetRecepcao2Stub.NfeDadosMsg.Factory.parse(dadosXML);
String respStatus = stub.nfeRetRecepcao2(nfeDadosMsg, cabecMsgE).getExtraElement().toString();
System.out.println(respStatus);
} catch (Exception e) {
System.out.println(e);
}
DeGuedes
Ae galera fiz umas alterações e deu certo, porém agora aparece outro erro:
<cStat>565</cStat><xMotivo>Rejeicao: Falha no schema XML - inexiste a tag raiz esperada para o lote de NF-e (Elemento: NFe[0])
alguem sabe o q pode ser?
DeGuedes
Boaa Zoren
Deu certo aquiiii!
Muito obrigado!
raf_ho
Ola.
Estou com o mesmo problema mas nao consegui resolver desta forma
qual tag vc adicionou exatamente e em que local do xml?
grato