Bem pessoal to quebrando a cabeça para consumir o web service status do serviço da nfe
quando rodo o programa da o erro
org.apache.axis2.AxisFault: Transport error: 403 Error: Forbidden
Eu tentei acessar o web service pelo google chrome e deu o mesmo erro, já no IE vai certinho, eu creio que deve ser alguma coisa no meu certificado
segue o codigo abaixo
public void consultarStatusServico(String codigoEstado)
{
try
{
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", "C:\\certificado\\certificado1.pfx");
System.setProperty("javax.net.ssl.keyStorePassword", "senha");
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStore", "C:\\certificado\\nfe.keystore");
NfeStatusServico2Stub stub = new NfeStatusServico2Stub();
NfeStatusServico2Stub.NfeDadosMsg dados = new NfeStatusServico2Stub.NfeDadosMsg();
String s = "<consStatServ versao=\"2.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\">"+
"<tpAmb>2</tpAmb>"+
"<cUF>"+codigoEstado+"</cUF>"+
"<xServ>STATUS</xServ>"+
"</consStatServ>";
OMElement el = AXIOMUtil.stringToOM(s);
dados.setExtraElement(el);
NfeStatusServico2Stub.NfeCabecMsg cab = new NfeStatusServico2Stub.NfeCabecMsg();
cab.setVersaoDados("2.00");
cab.setCUF(codigoEstado);
NfeStatusServico2Stub.NfeCabecMsgE cabE = new NfeStatusServico2Stub.NfeCabecMsgE();
cabE.setNfeCabecMsg(cab);
System.out.println(stub.nfeStatusServicoNF2(dados , cabE).getExtraElement());
}
catch (AxisFault e)
{
e.printStackTrace();
}
catch (RemoteException e)
{
e.printStackTrace();
}
catch (XMLStreamException e)
{
e.printStackTrace();
}
}