Problema com Retorno Consulta Status NF-e

0 respostas
T

Boa tarde pessoal!

Tenho um problema com o retorno de um cliente Web Service feito com JAX-WS. O código que faz a chamada é o seguinte:

public static void main(String... args) {

//      Autenticação com o serviço da NF-e omitido

        ConsStatServ dados = new ConsStatServ();
        dados.setCUF(25);
        
        NfeDadosMsg nfeDadosMsg = new NfeDadosMsg();
        nfeDadosMsg.getContent().add(dados);
        
        NfeCabecMsg cabecalho = new NfeCabecMsg();
        cabecalho.setCUF("25");
        cabecalho.setVersaoDados("2.00");
        
        Holder<NfeCabecMsg> nfeCabecMsg = new Holder<NfeCabecMsg>(cabecalho);
		
        System.out.println("***********************");
        System.out.println("Create Web Service Client...");
        
        NfeStatusServico2 service1 = new NfeStatusServico2();
//        service1.setHandlerResolver(new NFeHandlerResolver());
        
        System.out.println("Create Web Service...");
        
        NfeStatusServico2Soap12 port2 = service1.getNfeStatusServico2Soap12();
        
        System.out.println("Call Web Service Operation...");

        NfeStatusServicoNF2Result result = port2.nfeStatusServicoNF2(nfeDadosMsg, nfeCabecMsg);
        
        List<Object> content = result.getContent();
        
        System.out.println("Server said: " + content.get(0));
        System.out.println("***********************");
        System.out.println("Call Over!");
}

E o retorno que tenho é esse:

***********************
Create Web Service Client...
Create Web Service...
Call Web Service Operation...

---[HTTP request - https://homologacao.nfe.sefazvirtual.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx]---
Accept: [application/soap+xml, multipart/related]
Content-Type: [application/soap+xml; charset=utf-8;action="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2/nfeStatusServicoNF2"]
User-Agent: [JAX-WS RI 2.2.4-b01]
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
	<S:Header>
		<nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
			<cUF>25</cUF>
			<versaoDados>2.00</versaoDados>
		</nfeCabecMsg>
	</S:Header>
	<S:Body>
		<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
			<consStatServ versao="2.00" xmlns="http://www.portalfiscal.inf.br/nfe">
				<tpAmb>2</tpAmb>
				<cUF>25</cUF>
				<xServ>STATUS</xServ>
			</consStatServ>
		</nfeDadosMsg>
	</S:Body>
</S:Envelope>--------------------
---[HTTP response - https://homologacao.nfe.sefazvirtual.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx - 200]---
null: [HTTP/1.1 200 OK]
Cache-Control: [private, max-age=0]
Content-Length: [799]
Content-Type: [application/soap+xml; charset=utf-8]
Date: [Tue, 22 Apr 2014 17:31:55 GMT]
Server: [Microsoft-IIS/6.0]
X-AspNet-Version: [2.0.50727]
X-Powered-By: [ASP.NET]
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Header>
		<nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
			<cUF>25</cUF>
			<versaoDados>2.00</versaoDados>
		</nfeCabecMsg>
	</soap:Header>
	<soap:Body>
		<nfeStatusServicoNF2Result xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
			<retConsStatServ versao="2.00" xmlns="http://www.portalfiscal.inf.br/nfe">
				<tpAmb>2</tpAmb>
				<verAplic>SVRS20131126155321</verAplic>
				<cStat>107</cStat>
				<xMotivo>Servico em Operacao</xMotivo>
				<cUF>25</cUF>
				<dhRecbto>2014-04-22T14:31:55</dhRecbto>
				<tMed>1</tMed>
			</retConsStatServ>
		</nfeStatusServicoNF2Result>
	</soap:Body>
</soap:Envelope>--------------------

Server said: [retConsStatServ: null]
***********************
Call Over!

O servidor da NF-e me retorna que está tudo funcionando

<nfeStatusServicoNF2Result xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
	<retConsStatServ versao="2.00" xmlns="http://www.portalfiscal.inf.br/nfe">
		<tpAmb>2</tpAmb>
		<verAplic>SVRS20131126155321</verAplic>
		<cStat>107</cStat>
		<xMotivo>Servico em Operacao</xMotivo>
		<cUF>25</cUF>
		<dhRecbto>2014-04-22T14:31:55</dhRecbto>
		<tMed>1</tMed>
	</retConsStatServ>
</nfeStatusServicoNF2Result>

só que quando tento recuperar esse valor com

List<Object> content = result.getContent();
        System.out.println("Server said: " + content.get(0));

Ele me retorna nulo.

Server said: [retConsStatServ: null]

Aguém pode me ajudar na forma de obter corretamente esse retorno?

Desde já agradeço.

Até mais.

Criado 22 de abril de 2014
Respostas 0
Participantes 1