javax.xml.ws.soap.SOAPFaultException: Server was unable to read request. —> There is an error in XML document (168, 17). —> The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.
at com.sun.xml.internal.ws.fault.SOAP12Fault.getProtocolException(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy36.nfeRecepcaoLote2(Unknown Source)
at notaeletronica.servicos.EnviarNFe.enviar(EnviarNFe.java:157)
at faturamento.enviodenotafiscaleletronica.ThreadEnvioDeNotaEletronica.run(ThreadEnvioDeNotaEletronica.java:201)
at java.lang.Thread.run(Unknown Source)
Eu olhei o link… Eu fiz a geração das classes pelo JAXB e engraçado que ele não gerou a classe NfeStatusServico2Stub.
Será que há algum problema com as classes geradas pelo JAXB.
String xml = " <consReciNFe xmlns=“http://www.portalfiscal.inf.br/nfe” versao=“2.00”>2351000028049178";
NfeCabecMsg cabecMsg = new NfeCabecMsg();
cabecMsg.setCUF(“42”);
cabecMsg.setVersaoDados(“2.00”);
NfeDadosMsg nfeDadosMsg = new NfeDadosMsg();
nfeDadosMsg.getContent().add(xml);
NfeRecepcao2 nfe = new NfeRecepcao2();
NfeRecepcao2Soap12 nfeSoap = nfe.getNfeRecepcao2Soap12();
NfeRecepcaoLote2Result respo = nfeSoap.nfeRecepcaoLote2(nfeDadosMsg, new Holder(cabecMsg));
Dá o seguinte erro:
MENSAGEM: Server was unable to read request. —> There is an error in XML document (1, 560). —> The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.
STACKTRACE:
com.sun.xml.internal.ws.fault.SOAP12Fault - Linha -1
com.sun.xml.internal.ws.fault.SOAPFaultBuilder - Linha -1
com.sun.xml.internal.ws.client.sei.SyncMethodHandler - Linha -1
com.sun.xml.internal.ws.client.sei.SyncMethodHandler - Linha -1
com.sun.xml.internal.ws.client.sei.SEIStub - Linha -1
$Proxy36 - Linha -1
notaeletronica.servicos.EnviarNFe - Linha 189
faturamento.enviodenotafiscaleletronica.ThreadEnvioDeNotaEletronica - Linha 201
java.lang.Thread