rodrigobraz 1 de mar. de 2010
eu tbem estou com problemas pra usar o ws nessa versão nova.
eu uso o netbeans pra gerar os códigos e ele gerou o código abaixo:
br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServico2 service =
new br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServico2();
br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServico2Soap12 port =
service.getNfeStatusServico2Soap12();
br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServicoNF2.NfeDadosMsg nfeDadosMsg =
new br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServicoNF2.NfeDadosMsg();
br.inf.portalfiscal.nfe.wsdl.nfestatusservico2.NfeStatusServicoNF2Response.NfeStatusServicoNF2Result result =
port.nfeStatusServicoNF2(nfeDadosMsg);
System.out.println("Result = " + result);
mas não sei como usar o cabeçalho e o dadosnfe neste código...
se alguém souber e puder ajudar, agradeço...
vlw
Saulo.Java 8 de mar. de 2010
Boa Tarde
Estou com o mesmo problemas mais em c#.
uma coisa que pude perceber foram que os parametros não são mais strings.
No caso do c# quando importa o arquivo wsdl ele pede como parametro o XmlNode
Não deveria ser uma string contendo o XML ?
Obrigado
Saulo.Java 10 de mar. de 2010
Boa Tarde
pessoal conseguir resolver o erro "Object reference not set to an instance of an object " no c#
coloquei o certificado digital e set o retorno em XmlNode
e funcionou perfeitamente . espero que isso ajude
mate42 10 de mar. de 2010
Estou com o mesmo problema, estou gerando o fonte pelo JAX-WS …
NfeStatusServico2 servico = new NfeStatusServico2 ();
NfeStatusServico2Soap12 a = servico . getNfeStatusServico2Soap12 ();
NfeCabecMsg cab = new NfeCabecMsg ();
cab . setCUF ( "43" );
cab . setVersaoDados ( "2.00" );
NfeDadosMsg dados = new NfeDadosMsg ();
dados . getContent (). add ( new ObjectFactory (). createNfeCabecMsg ( cab ));
System . out . println ( Arrays . toString ( a . nfeStatusServicoNF2 ( dados ). getContent (). toArray ()));
Se alguém puder ajudar
mate42 12 de mar. de 2010
Consegui resolver, segue:
Baixe o Apache AXIS para gerar as classes a partir do WSDl, http://ws.apache.org/axis2/download.cgi
Depois de descompactar, execute dentro da pasta BIN “/wsdl2java.sh -uri NFeStatusServico2.wsdl” (Linux)
Copie os fontes para a pasta do projeto, inclua as bibliotecas do Apache AXIS no projeto
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>43</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 ( "43" );
NfeStatusServico2Stub . NfeCabecMsgE cabE = new NfeStatusServico2Stub . NfeCabecMsgE ();
cabE . setNfeCabecMsg ( cab );
System . out . println ( stub . nfeStatusServicoNF2 ( dados , cabE ). getExtraElement ());
Mackrophus 18 de mar. de 2010
mate42 cara, voce conseguiu enviar a NF-e?
Eu to usando o teu exemplo e não consigo, sempre me retorna
Rejeicao : Falha no schema XML ? inexiste a tag raiz esperada para a mensagem
Ai eu tava olhando o codigo e quando eu faço ele retira a tag
Como que eu posso fazer pra ele enviar corretamente a mensagem?
mate42 22 de mar. de 2010
Posta seu código, dai posso da uma analisada !
philler 23 de mar. de 2010
Creio que vocês saibam, este assunto está sendo bastante discutido neste outro forum:
http://www.guj.com.br/posts/list/480/72325.java#1018290
Abracos.
Alencar
Mackrophus 23 de mar. de 2010
Olá Mate42.
Cara eu to fazendo assim.
NfeRecepcao2Stub . NfeCabecMsg cabecalho = new NfeRecepcao2Stub . NfeCabecMsg ();
cabecalho . setCUF ( "43" );
cabecalho . setVersaoDados ( "2.00" );
NfeRecepcao2Stub . NfeCabecMsgE cabE = new NfeRecepcao2Stub . NfeCabecMsgE ();
cabE . setNfeCabecMsg ( cabecalho );
OMElement el = null ;
try {
el = AXIOMUtil . stringToOM ( nfeDadosMsg );
} catch ( XMLStreamException e1 ) {
// TODO Auto-generated catch block
e1 . printStackTrace ();
}
el . build ();
System . out . println ( "el -> " + el . toString ());
NfeRecepcao2Stub . NfeDadosMsg dadosMsg = new NfeRecepcao2Stub . NfeDadosMsg ();
dadosMsg . setExtraElement ( el );
NfeRecepcao2Stub . NfeRecepcaoLote2Result result = null ;
try {
result = new NfeRecepcao2Stub (). nfeRecepcaoLote2 ( dadosMsg , cabE );
} catch ( AxisFault e ) {
// TODO Auto-generated catch block
e . printStackTrace ();
} catch ( RemoteException e ) {
// TODO Auto-generated catch block
e . printStackTrace ();
}
System . out . println ( "Result: " + result . getExtraElement (). toString ());
Ta como que eu to enviando, mas, ele sempre dá aquele erro.
Andre_Brito 23 de mar. de 2010
Mac, tem certeza que deve ser assim?
result = new NfeRecepcao2Stub (). nfeRecepcaoLote2 ( dadosMsg , cabE );
E não:
result = new NfeRecepcao2Stub . NfeRecepcaoLote2 ( dadosMsg , cabe );
?
Eu fiz esse código hoje, mas não consigo lembrar o que fiz :\
Aliás, vi que você falou que ele tira o <xml…> né? Você já tentou montar como string mesmo e colocar no NfeDadosMsg? Porque tem uma parte do xml que fica sem o <xml…> mesmo, que é o conteúdo em si. Se não me falha a memória ele só colocar o <xml…> quando está envelopando o bixo (não acredite totalmente porque não tenho nem um pingo de certeza do que estou falando :p).
philler 23 de mar. de 2010
Mackrophus:
Olá Mate42.
Cara eu to fazendo assim.
Muito parecido com o meu, mas não uso o e1.build().
Detalhe: na minha String xml também contém o header <?.. e não tenho problemas com isso. Pelo menos até agora
try {
OMElement ome = AXIOMUtil.stringToOM(this.xml) ;
NfeRecepcao2Stub.NfeDadosMsg dadosMsg = new NfeRecepcao2Stub.NfeDadosMsg() ;
dadosMsg.setExtraElement(ome) ;
NfeRecepcao2Stub.NfeCabecMsg nfeCabecMsg = new NfeRecepcao2Stub.NfeCabecMsg() ;
nfeCabecMsg.setCUF(this.config.getCodigoUF()) ;
nfeCabecMsg.setVersaoDados(this.layoutDados) ;
NfeRecepcao2Stub.NfeCabecMsgE nfeCabecMsgE = new NfeRecepcao2Stub.NfeCabecMsgE() ;
nfeCabecMsgE.setNfeCabecMsg(nfeCabecMsg) ;
NfeRecepcao2Stub stub = new NfeRecepcao2Stub() ;
xmlRetorno = stub.nfeRecepcaoLote2(dadosMsg, nfeCabecMsgE).getExtraElement().toString() ;
} catch ( Exception e ) {
Utils.gravaLog("Erro enviando lote de notas : " + e.getMessage());
xmlRetorno = " " ;
return false ;
}
Alencar
Andre_Brito 24 de mar. de 2010
O JAX-WS faz a mesma coisa, só cria mais arquivos… No final das contas dá tudo na mesma…
JJSaraiva 24 de mar. de 2010
Olá, pessoal.
Estou com problemas com esse serviço na versão 2.00
Consigo verificar status do serviço e consultar situação de NF-e sem problemas, mas quando vou enviar uma NF-e, o seguinte erro é gerado:
[color=red]Message part {http://www.portalfiscal.inf.br/nfe/wsdl/NfeRecepcao2 }nfeDadosMsg was not recognized. (Does it exist in service WSDL?)[/color]
Já tentei usar os serviços de vários estados, mas o erro é o mesmo.
Utilizo C#. Se alguém tiver alguma dica, agradeço muito.
Valeu.
JJSaraiva
Andre_Brito 24 de mar. de 2010
Quais classes foram criadas com o JAX-WS?
Mackrophus 25 de mar. de 2010
Aix cara, dá uma verificada na cadeia de certificados do servidor, pq isso…
é relativo a trustStore que não ta achando.
Abraço.
Vanderbill 19 de abr. de 2010
Boa tarde pessoal.
Estou tentando consultar o status da nfe 2.00 porém sem sucesso.
Baixei o Apache Axis 2 e gerei as classes através do wsdl.
Segue o codigo
NfeStatusServico2Stub stub = new NfeStatusServico2Stub ();
NfeStatusServico2Stub . NfeDadosMsg dados = new NfeStatusServico2Stub . NfeDadosMsg ();
String s = "<consStatServ xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\"><tpAmb>2</tpAmb><cUF>31</cUF><xServ>STATUS</xServ></consStatServ>" ;
OMElement el = null ;
try {
el = AXIOMUtil . stringToOM ( s );
} catch ( XMLStreamException e ){
e . printStackTrace ();
}
dados . setExtraElement ( el );
NfeStatusServico2Stub . NfeCabecMsg cab = new NfeStatusServico2Stub . NfeCabecMsg ();
cab . setVersaoDados ( "2.00" );
cab . setCUF ( "31" ); //codigo de MG
NfeStatusServico2Stub . NfeCabecMsgE cabE = new NfeStatusServico2Stub . NfeCabecMsgE ();
cabE . setNfeCabecMsg ( cab );
System . out . println ( stub . nfeStatusServicoNF2 ( dados , cabE ). getExtraElement (). toString ());
porém ao executar tenho essa exception:
Sistema : Windows 7 x86 6.1
17 : 50 : 52 , 362 INFOR Banco de dados : POSTGRESQL ...
17 : 50 : 52 , 538 INFOR [ D3Talk . conecta ()] Testando Conexão com porta : 5432
17 : 50 : 52 , 538 OK [ D3Talk . conecta ()] Conectado em 192.168 . 50.50 : 5432 \ Higident20100408
----- HOMOLOGACAO ----- NORMAL ------
log4j : WARN No appenders could be found for logger ( org . apache . axis2 . description . AxisService ).
log4j : WARN Please initialize the log4j system properly .
17 : 51 : 24 , 039 ERRO ! [ getBtnConsultar . actionPerformed ()] class org . apache . axis2 . AxisFault : Transport error : 404 Error : Not Found
org . apache . axis2 . AxisFault : Transport error : 404 Error : Not Found
at org . apache . axis2 . transport . http . HTTPSender . handleResponse ( HTTPSender . java : 310 )
at org . apache . axis2 . transport . http . HTTPSender . sendViaPost ( HTTPSender . java : 200 )
at org . apache . axis2 . transport . http . HTTPSender . send ( HTTPSender . java : 76 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . writeMessageWithCommons ( CommonsHTTPTransportSender . java : 400 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . invoke ( CommonsHTTPTransportSender . java : 225 )
at org . apache . axis2 . engine . AxisEngine . send ( AxisEngine . java : 435 )
at org . apache . axis2 . description . OutInAxisOperationClient . send ( OutInAxisOperation . java : 402 )
at org . apache . axis2 . description . OutInAxisOperationClient . executeImpl ( OutInAxisOperation . java : 229 )
at org . apache . axis2 . client . OperationClient . execute ( OperationClient . java : 165 )
at br . inf . portalfiscal . www . nfe . wsdl . NfeStatusServico2 . NfeStatusServico2Stub . nfeStatusServicoNF2 ( NfeStatusServico2Stub . java : 159 )
at javax . swing . AbstractButton . fireActionPerformed ( Unknown Source )
at javax . swing . AbstractButton $Handler . actionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . fireActionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . setPressed ( Unknown Source )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( Unknown Source )
at java . awt . Component . processMouseEvent ( Unknown Source )
at javax . swing . JComponent . processMouseEvent ( Unknown Source )
at java . awt . Component . processEvent ( Unknown Source )
at java . awt . Container . processEvent ( Unknown Source )
at java . awt . Component . dispatchEventImpl ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . processMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . dispatchEvent ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Window . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . EventQueue . dispatchEvent ( Unknown Source )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForFilter ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . run ( Unknown Source )
Já estou nisso a 2 dias e não acho a resposta.
Alguem já passou por isso.
Obrigado t+
Vanderbill 20 de abr. de 2010
Boa Tarde.
Tentando ainda resolver o problema acima, fiz a consulta para o ambiente de produção.
E recebi o seguinte erro.
Sistema : Windows 7 x86 6.1
log4j : WARN No appenders could be found for logger ( org . apache . axiom . om . impl . builder . StAXOMBuilder ).
log4j : WARN Please initialize the log4j system properly .
org . apache . axis2 . AxisFault : pnfe . fazenda . mg . gov . br
at org . apache . axis2 . AxisFault . makeFault ( AxisFault . java : 430 )
at org . apache . axis2 . transport . http . HTTPSender . sendViaPost ( HTTPSender . java : 203 )
at org . apache . axis2 . transport . http . HTTPSender . send ( HTTPSender . java : 76 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . writeMessageWithCommons ( CommonsHTTPTransportSender . java : 400 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . invoke ( CommonsHTTPTransportSender . java : 225 )
at org . apache . axis2 . engine . AxisEngine . send ( AxisEngine . java : 435 )
at org . apache . axis2 . description . OutInAxisOperationClient . send ( OutInAxisOperation . java : 402 )
at org . apache . axis2 . description . OutInAxisOperationClient . executeImpl ( OutInAxisOperation . java : 229 )
at org . apache . axis2 . client . OperationClient . execute ( OperationClient . java : 165 )
at br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . nfeStatusServicoNF2 ( NfeStatusServico2Stub . java : 159 )
at javax . swing . AbstractButton . fireActionPerformed ( Unknown Source )
at javax . swing . AbstractButton $Handler . actionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . fireActionPerformed ( Unknown Source )
at javax . swing . DefaultButtonModel . setPressed ( Unknown Source )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( Unknown Source )
at java . awt . Component . processMouseEvent ( Unknown Source )
at javax . swing . JComponent . processMouseEvent ( Unknown Source )
at java . awt . Component . processEvent ( Unknown Source )
at java . awt . Container . processEvent ( Unknown Source )
at java . awt . Component . dispatchEventImpl ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . processMouseEvent ( Unknown Source )
at java . awt . LightweightDispatcher . dispatchEvent ( Unknown Source )
at java . awt . Container . dispatchEventImpl ( Unknown Source )
at java . awt . Window . dispatchEventImpl ( Unknown Source )
at java . awt . Component . dispatchEvent ( Unknown Source )
at java . awt . EventQueue . dispatchEvent ( Unknown Source )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForFilter ( Unknown Source )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . pumpEvents ( Unknown Source )
at java . awt . EventDispatchThread . run ( Unknown Source )
Caused by : java . net . UnknownHostException : pnfe . fazenda . mg . gov . br
at java . net . PlainSocketImpl . connect ( Unknown Source )
at java . net . SocksSocketImpl . connect ( Unknown Source )
at java . net . Socket . connect ( Unknown Source )
at com . sun . net . ssl . internal . ssl . SSLSocketImpl . connect ( Unknown Source )
at com . sun . net . ssl . internal . ssl . SSLSocketImpl .< init >( Unknown Source )
at com . sun . net . ssl . internal . ssl . SSLSocketFactoryImpl . createSocket ( Unknown Source )
at org . apache . commons . httpclient . protocol . SSLProtocolSocketFactory . createSocket ( SSLProtocolSocketFactory . java : 82 )
at org . apache . commons . httpclient . protocol . ControllerThreadSocketFactory $1 . doit ( ControllerThreadSocketFactory . java : 91 )
at org . apache . commons . httpclient . protocol . ControllerThreadSocketFactory $SocketTask . run ( ControllerThreadSocketFactory . java : 158 )
at java . lang . Thread . run ( Unknown Source )
segue o código.
nfeDadosMsg = "<nfeDadosMsg><consStatServ versao=\"2.00\"" + " xmlns=\"http://www.portalfiscal.inf.br/nfe\">" + "<tpAmb>1</tpAmb><cUF>31</cUF><xServ>STATUS</xServ></consStatServ></nfeDadosMsg>" ;
try {
br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeCabecMsg nfeCabec = new br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeCabecMsg ();
nfeCabec . setCUF ( "31" );
nfeCabec . setVersaoDados ( "2.00" );
br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeCabecMsgE nfeCabecE = new br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeCabecMsgE ();
nfeCabecE . setNfeCabecMsg ( nfeCabec );
br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeDadosMsg nfeDados = new br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeDadosMsg ();
javax . xml . stream . XMLStreamReader XML = XMLInputFactory . newInstance (). createXMLStreamReader ( new StringReader ( nfeDadosMsg ));
nfeDados = br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub . NfeDadosMsg . Factory . parse ( XML );
br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub nfeStub = new br . inf . portalfiscal . www . nfe . wsdl . producao . mg . nfestatusservico2 . NfeStatusServico2Stub ();
String strXMLRetorno = nfeStub . nfeStatusServicoNF2 ( nfeDados , nfeCabecE ). getExtraElement (). toString ();
System . out . println ( strXMLRetorno );
} catch ( Throwable e1 ){
e1 . printStackTrace ();
}
na nfe de mg nao consegui fazer nada. alguem ja passou por isso?
Desde ja agradeco.
Vanderbill 23 de abr. de 2010
Bom dia pessoal.
Consegui resolver o problema. O código esta certo.
O WSDL de mg esta gerando as classes com o endereco errado.
public NfeStatusServico2Stub ( org . apache . axis2 . context . ConfigurationContext configurationContext ) throws org . apache . axis2 . AxisFault {
this(configurationContext, " https : // hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(configurationContext, " https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 "); endereco gerado pelo wsdl
}
/**
* Default Constructor
*/
public NfeStatusServico2Stub() throws org.apache.axis2.AxisFault {
this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 " ); endereco gerado pelo wsdl
}
flw galera t+
abcvilela 23 de abr. de 2010
JJSaraiva você conseguiu resolver este problema?
JJSaraiva:
Olá, pessoal.
Estou com problemas com esse serviço na versão 2.00
Consigo verificar status do serviço e consultar situação de NF-e sem problemas, mas quando vou enviar uma NF-e, o seguinte erro é gerado:
[color=red]Message part {http://www.portalfiscal.inf.br/nfe/wsdl/NfeRecepcao2 }nfeDadosMsg was not recognized. (Does it exist in service WSDL?)[/color]
Já tentei usar os serviços de vários estados, mas o erro é o mesmo.
Utilizo C#. Se alguém tiver alguma dica, agradeço muito.
Valeu.
JJSaraiva
Orlando.Neto 19 de jul. de 2010
Vanderbill:
Bom dia pessoal.
Consegui resolver o problema. O código esta certo.
O WSDL de mg esta gerando as classes com o endereco errado.
public NfeStatusServico2Stub ( org . apache . axis2 . context . ConfigurationContext configurationContext ) throws org . apache . axis2 . AxisFault {
this(configurationContext, " https : // hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(configurationContext, " https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 "); endereco gerado pelo wsdl
}
/**
* Default Constructor
*/
public NfeStatusServico2Stub() throws org.apache.axis2.AxisFault {
this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 " ); endereco gerado pelo wsdl
}
flw galera t+
Amigo, tive o mesmo problema que você, tb fazendo para o wsdl de MG, logo após consertar esses endereços mencionados por vc tive o seguinte erro:
java . lang . RuntimeException : org . apache . axis2 . AxisFault : Transport level information does not match with SOAP Message namespace URI ; nested exception is :
org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at xpro . xmanager . logic . impl . logistica . notafiscaleletronica . NotaFiscalEletronicaImpl . queryStatusService2 ( NotaFiscalEletronicaImpl . java : 436 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . springframework . aop . support . AopUtils . invokeJoinpointUsingReflection ( AopUtils . java : 307 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . invokeJoinpoint ( ReflectiveMethodInvocation . java : 182 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 149 )
at org . springframework . transaction . interceptor . TransactionInterceptor . invoke ( TransactionInterceptor . java : 106 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . interceptor . ExposeInvocationInterceptor . invoke ( ExposeInvocationInterceptor . java : 89 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . framework . JdkDynamicAopProxy . invoke ( JdkDynamicAopProxy . java : 204 )
at $ Proxy69 . queryStatusService2 ( Unknown Source )
at xpro . xmanager . modelo . logistica . notafiscaleletronica . NotaFiscalEletronicaTest . nfeStatusServicoTest ( NotaFiscalEletronicaTest . java : 628 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . junit . runners . model . FrameworkMethod $ 1 . runReflectiveCall ( FrameworkMethod . java : 44 )
at org . junit . internal . runners . model . ReflectiveCallable . run ( ReflectiveCallable . java : 15 )
at org . junit . runners . model . FrameworkMethod . invokeExplosively ( FrameworkMethod . java : 41 )
at org . junit . internal . runners . statements . InvokeMethod . evaluate ( InvokeMethod . java : 20 )
at org . junit . internal . runners . statements . RunBefores . evaluate ( RunBefores . java : 28 )
at org . junit . internal . runners . statements . RunAfters . evaluate ( RunAfters . java : 31 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 76 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 50 )
at org . junit . runners . ParentRunner $ 3 . run ( ParentRunner . java : 193 )
at org . junit . runners . ParentRunner $ 1 . schedule ( ParentRunner . java : 52 )
at org . junit . runners . ParentRunner . runChildren ( ParentRunner . java : 191 )
at org . junit . runners . ParentRunner . access $ 000 ( ParentRunner . java : 42 )
at org . junit . runners . ParentRunner $ 2 . evaluate ( ParentRunner . java : 184 )
at org . junit . runners . ParentRunner . run ( ParentRunner . java : 236 )
at org . eclipse . jdt . internal . junit4 . runner . JUnit4TestReference . run ( JUnit4TestReference . java : 49 )
at org . eclipse . jdt . internal . junit . runner . TestExecution . run ( TestExecution . java : 38 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 467 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 683 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . run ( RemoteTestRunner . java : 390 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . main ( RemoteTestRunner . java : 197 )
Caused by : org . apache . axis2 . AxisFault : Transport level information does not match with SOAP Message namespace URI ; nested exception is :
org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 126 )
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 67 )
at org . apache . axis2 . description . OutInAxisOperationClient . send ( OutInAxisOperation . java : 252 )
at org . apache . axis2 . description . OutInAxisOperationClient . execute ( OutInAxisOperation . java : 202 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . nfeStatusServicoNF2 ( NfeStatusServico2Stub . java : 219 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . getService ( NfeStatusServico2Stub . java : 2789 )
at xpro . xmanager . logic . impl . logistica . notafiscaleletronica . NotaFiscalEletronicaImpl . queryStatusService2 ( NotaFiscalEletronicaImpl . java : 432 )
... 38 more
Caused by : org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at org . apache . axiom . soap . impl . builder . StAXSOAPModelBuilder . identifySOAPVersion ( StAXSOAPModelBuilder . java : 144 )
at org . apache . axiom . soap . impl . builder . StAXSOAPModelBuilder .< init >( StAXSOAPModelBuilder . java : 98 )
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 120 )
... 44 more
Você teve isso também?
vcsmetallica 20 de jul. de 2010
Orlando.Neto:
Vanderbill:
Bom dia pessoal.
Consegui resolver o problema. O código esta certo.
O WSDL de mg esta gerando as classes com o endereco errado.
public NfeStatusServico2Stub ( org . apache . axis2 . context . ConfigurationContext configurationContext ) throws org . apache . axis2 . AxisFault {
this(configurationContext, " https : // hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(configurationContext, " https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 "); endereco gerado pelo wsdl
}
/**
* Default Constructor
*/
public NfeStatusServico2Stub() throws org.apache.axis2.AxisFault {
this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatus2 "); // endereço correto
// this(" https :// hnfe . fazenda . mg . gov . br / nfe2 / services / NfeStatusServico2 " ); endereco gerado pelo wsdl
}
flw galera t+
Amigo, tive o mesmo problema que você, tb fazendo para o wsdl de MG, logo após consertar esses endereços mencionados por vc tive o seguinte erro:
java . lang . RuntimeException : org . apache . axis2 . AxisFault : Transport level information does not match with SOAP Message namespace URI ; nested exception is :
org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at xpro . xmanager . logic . impl . logistica . notafiscaleletronica . NotaFiscalEletronicaImpl . queryStatusService2 ( NotaFiscalEletronicaImpl . java : 436 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . springframework . aop . support . AopUtils . invokeJoinpointUsingReflection ( AopUtils . java : 307 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . invokeJoinpoint ( ReflectiveMethodInvocation . java : 182 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 149 )
at org . springframework . transaction . interceptor . TransactionInterceptor . invoke ( TransactionInterceptor . java : 106 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . interceptor . ExposeInvocationInterceptor . invoke ( ExposeInvocationInterceptor . java : 89 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . framework . JdkDynamicAopProxy . invoke ( JdkDynamicAopProxy . java : 204 )
at $ Proxy69 . queryStatusService2 ( Unknown Source )
at xpro . xmanager . modelo . logistica . notafiscaleletronica . NotaFiscalEletronicaTest . nfeStatusServicoTest ( NotaFiscalEletronicaTest . java : 628 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . junit . runners . model . FrameworkMethod $ 1 . runReflectiveCall ( FrameworkMethod . java : 44 )
at org . junit . internal . runners . model . ReflectiveCallable . run ( ReflectiveCallable . java : 15 )
at org . junit . runners . model . FrameworkMethod . invokeExplosively ( FrameworkMethod . java : 41 )
at org . junit . internal . runners . statements . InvokeMethod . evaluate ( InvokeMethod . java : 20 )
at org . junit . internal . runners . statements . RunBefores . evaluate ( RunBefores . java : 28 )
at org . junit . internal . runners . statements . RunAfters . evaluate ( RunAfters . java : 31 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 76 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 50 )
at org . junit . runners . ParentRunner $ 3 . run ( ParentRunner . java : 193 )
at org . junit . runners . ParentRunner $ 1 . schedule ( ParentRunner . java : 52 )
at org . junit . runners . ParentRunner . runChildren ( ParentRunner . java : 191 )
at org . junit . runners . ParentRunner . access $ 000 ( ParentRunner . java : 42 )
at org . junit . runners . ParentRunner $ 2 . evaluate ( ParentRunner . java : 184 )
at org . junit . runners . ParentRunner . run ( ParentRunner . java : 236 )
at org . eclipse . jdt . internal . junit4 . runner . JUnit4TestReference . run ( JUnit4TestReference . java : 49 )
at org . eclipse . jdt . internal . junit . runner . TestExecution . run ( TestExecution . java : 38 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 467 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 683 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . run ( RemoteTestRunner . java : 390 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . main ( RemoteTestRunner . java : 197 )
Caused by : org . apache . axis2 . AxisFault : Transport level information does not match with SOAP Message namespace URI ; nested exception is :
org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 126 )
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 67 )
at org . apache . axis2 . description . OutInAxisOperationClient . send ( OutInAxisOperation . java : 252 )
at org . apache . axis2 . description . OutInAxisOperationClient . execute ( OutInAxisOperation . java : 202 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . nfeStatusServicoNF2 ( NfeStatusServico2Stub . java : 219 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . getService ( NfeStatusServico2Stub . java : 2789 )
at xpro . xmanager . logic . impl . logistica . notafiscaleletronica . NotaFiscalEletronicaImpl . queryStatusService2 ( NotaFiscalEletronicaImpl . java : 432 )
... 38 more
Caused by : org . apache . axiom . soap . SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at org . apache . axiom . soap . impl . builder . StAXSOAPModelBuilder . identifySOAPVersion ( StAXSOAPModelBuilder . java : 144 )
at org . apache . axiom . soap . impl . builder . StAXSOAPModelBuilder .< init >( StAXSOAPModelBuilder . java : 98 )
at org . apache . axis2 . transport . TransportUtils . createSOAPMessage ( TransportUtils . java : 120 )
... 44 more
Você teve isso também?
Orlando, você conseguiu resolver esse problema?
Orlando.Neto 20 de jul. de 2010
kra…pelo que vi esse problema só ocorre quando vc fica no “debug” no stub, se passar direto, sem debbugar isso não rola…
consegui deixar meu xml dá seguinte forma, retirando os prefixos.
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv= "http://www.w3.org/2003/05/soap-envelope" >
<soapenv:Header>
<nfeCabecMsg xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2"
soapenv:mustUnderstand= "false" >
<cUF> 31</cUF>
<versaoDados> 2.00</versaoDados>
</nfeCabecMsg>
</soapenv:Header>
<soapenv:Body>
<nfeDadosMsg xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" >
<consStatServ xmlns= "http://www.portalfiscal.inf.br/nfe"
versao= "2.00" >
<tpAmb> 2</tpAmb>
<cUF> 31</cUF>
<xServ> STATUS</xServ>
</consStatServ>
</nfeDadosMsg>
</soapenv:Body>
</soapenv:Envelope>
mas ainda assim não passa pelo método serialize do msg
java . lang . AbstractMethodError : nfe . impl . homologacao . statusservico . NfeStatusServico2Stub $ NfeDadosMsg $ 1 . serialize ( Ljavax / xml / stream / XMLStreamWriter ;) V
at org . apache . axiom . om . impl . llom . OMSourcedElementImpl . internalSerializeAndConsume ( OMSourcedElementImpl . java : 738 )
at org . apache . axiom . om . impl . llom . OMElementImpl . internalSerialize ( OMElementImpl . java : 966 )
at org . apache . axiom . om . impl . llom . OMElementImpl . internalSerializeAndConsume ( OMElementImpl . java : 995 )
at org . apache . axiom . soap . impl . llom . SOAPEnvelopeImpl . serializeInternally ( SOAPEnvelopeImpl . java : 254 )
at org . apache . axiom . soap . impl . llom . SOAPEnvelopeImpl . internalSerialize ( SOAPEnvelopeImpl . java : 242 )
at org . apache . axiom . om . impl . llom . OMElementImpl . internalSerializeAndConsume ( OMElementImpl . java : 995 )
at org . apache . axiom . om . impl . llom . OMNodeImpl . serializeAndConsume ( OMNodeImpl . java : 486 )
at org . apache . axis2 . transport . http . SOAPOverHTTPSender $ AxisSOAPRequestEntity . handleOMOutput ( SOAPOverHTTPSender . java : 190 )
at org . apache . axis2 . transport . http . SOAPOverHTTPSender $ AxisSOAPRequestEntity . writeRequest ( SOAPOverHTTPSender . java : 232 )
at org . apache . commons . httpclient . methods . EntityEnclosingMethod . writeRequestBody ( EntityEnclosingMethod . java : 499 )
at org . apache . commons . httpclient . HttpMethodBase . writeRequest ( HttpMethodBase . java : 2114 )
at org . apache . commons . httpclient . HttpMethodBase . execute ( HttpMethodBase . java : 1096 )
at org . apache . commons . httpclient . HttpMethodDirector . executeWithRetry ( HttpMethodDirector . java : 398 )
at org . apache . commons . httpclient . HttpMethodDirector . executeMethod ( HttpMethodDirector . java : 171 )
at org . apache . commons . httpclient . HttpClient . executeMethod ( HttpClient . java : 397 )
at org . apache . commons . httpclient . HttpClient . executeMethod ( HttpClient . java : 346 )
at org . apache . axis2 . transport . http . AbstractHTTPSender . executeMethod ( AbstractHTTPSender . java : 541 )
at org . apache . axis2 . transport . http . SOAPOverHTTPSender . send ( SOAPOverHTTPSender . java : 119 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . writeMessageWithCommons ( CommonsHTTPTransportSender . java : 335 )
at org . apache . axis2 . transport . http . CommonsHTTPTransportSender . invoke ( CommonsHTTPTransportSender . java : 204 )
at org . apache . axis2 . engine . AxisEngine . send ( AxisEngine . java : 674 )
at org . apache . axis2 . description . OutInAxisOperationClient . send ( OutInAxisOperation . java : 237 )
at org . apache . axis2 . description . OutInAxisOperationClient . execute ( OutInAxisOperation . java : 202 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . nfeStatusServicoNF2 ( NfeStatusServico2Stub . java : 219 )
at nfe . impl . homologacao . statusservico . NfeStatusServico2Stub . getService ( NfeStatusServico2Stub . java : 2789 )
at xpro . xmanager . logic . impl . logistica . notafiscaleletronica . NotaFiscalEletronicaImpl . queryStatusService2 ( NotaFiscalEletronicaImpl . java : 432 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . springframework . aop . support . AopUtils . invokeJoinpointUsingReflection ( AopUtils . java : 307 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . invokeJoinpoint ( ReflectiveMethodInvocation . java : 182 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 149 )
at org . springframework . transaction . interceptor . TransactionInterceptor . invoke ( TransactionInterceptor . java : 106 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . interceptor . ExposeInvocationInterceptor . invoke ( ExposeInvocationInterceptor . java : 89 )
at org . springframework . aop . framework . ReflectiveMethodInvocation . proceed ( ReflectiveMethodInvocation . java : 171 )
at org . springframework . aop . framework . JdkDynamicAopProxy . invoke ( JdkDynamicAopProxy . java : 204 )
at $ Proxy69 . queryStatusService2 ( Unknown Source )
at xpro . xmanager . modelo . logistica . notafiscaleletronica . NotaFiscalEletronicaTest . nfeStatusServicoTest ( NotaFiscalEletronicaTest . java : 628 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 597 )
at org . junit . runners . model . FrameworkMethod $ 1 . runReflectiveCall ( FrameworkMethod . java : 44 )
at org . junit . internal . runners . model . ReflectiveCallable . run ( ReflectiveCallable . java : 15 )
at org . junit . runners . model . FrameworkMethod . invokeExplosively ( FrameworkMethod . java : 41 )
at org . junit . internal . runners . statements . InvokeMethod . evaluate ( InvokeMethod . java : 20 )
at org . junit . internal . runners . statements . RunBefores . evaluate ( RunBefores . java : 28 )
at org . junit . internal . runners . statements . RunAfters . evaluate ( RunAfters . java : 31 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 76 )
at org . junit . runners . BlockJUnit4ClassRunner . runChild ( BlockJUnit4ClassRunner . java : 50 )
at org . junit . runners . ParentRunner $ 3 . run ( ParentRunner . java : 193 )
at org . junit . runners . ParentRunner $ 1 . schedule ( ParentRunner . java : 52 )
at org . junit . runners . ParentRunner . runChildren ( ParentRunner . java : 191 )
at org . junit . runners . ParentRunner . access $ 000 ( ParentRunner . java : 42 )
at org . junit . runners . ParentRunner $ 2 . evaluate ( ParentRunner . java : 184 )
at org . junit . runners . ParentRunner . run ( ParentRunner . java : 236 )
at org . eclipse . jdt . internal . junit4 . runner . JUnit4TestReference . run ( JUnit4TestReference . java : 49 )
at org . eclipse . jdt . internal . junit . runner . TestExecution . run ( TestExecution . java : 38 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 467 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . runTests ( RemoteTestRunner . java : 683 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . run ( RemoteTestRunner . java : 390 )
at org . eclipse . jdt . internal . junit . runner . RemoteTestRunner . main ( RemoteTestRunner . java : 197 )
vcsmetallica 20 de jul. de 2010
Kra,
Esse negocio esta foda. Cada dia que passa fica pior!!!
Eu nao estou o modo debug.
Como vc olha o seu XML gerado?
Orlando.Neto 20 de jul. de 2010
Dentro do seu Stub tem isso aqui
env = toEnvelope (
getFactory ( _operationClient . getOptions ()
. getSoapVersionURI ()),
nfeDadosMsg0 ,
optimizeContent ( new javax . xml . namespace . QName (
"http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" ,
"nfeStatusServicoNF2" )));
env . build ();
esse env tem o xml.... ai vc olha nele como que fico, só que nesse ponto ele está sem o cabeçalho, para ver ele já com o cabeçalho
// add the children only if the parameter is not null
if ( nfeCabecMsg1 != null ) {
org . apache . axiom . om . OMElement omElementnfeCabecMsg1 = toOM (
nfeCabecMsg1 ,
optimizeContent ( new javax . xml . namespace . QName (
"http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" ,
"nfeStatusServicoNF2" )));
addHeader ( omElementnfeCabecMsg1 , env );
}
// adding SOAP soap_headers
_serviceClient . addHeadersToEnvelope ( env );
aqui ele add o cabeçalho no envelope
vcsmetallica 20 de jul. de 2010
Orlando,
Como que você fez para modificar o seu XML que esta dentro do env?
Tentei aqui mas nao tive sucesso.
Att
Orlando.Neto 20 de jul. de 2010
olha onde criam as instâncias do QNAME e tira o prefixo, ai gera sem
public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName(
"http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"nfeDadosMsg", "");
ai tem o qname do cabeçalho tb
vcsmetallica 20 de jul. de 2010
Orlando,
Retirei os prefixos e mesmo assim continua dando erro de SOAP
Meu XML gerado
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv= "http://www.w3.org/2003/05/soap-envelope" >
<soapenv:Header>
<nfeCabecMsg xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" soapenv:mustUnderstand= "false" >
<cUF> 31</cUF>
<versaoDados> 2.00</versaoDados>
</nfeCabecMsg>
</soapenv:Header>
<soapenv:Body>
<nfeDadosMsg xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" >
<consStatServ xmlns= "http://www.portalfiscal.inf.br/nfe" versao= "2.00" >
<tpAmb> 2</tpAmb>
<cUF> 31</cUF>
<xServ> STATUS</xServ>
</consStatServ>
</nfeDadosMsg>
</soapenv:Body>
</soapenv:Envelope>
Erro
rg .apache .axis2 .AxisFault : Transport level information does not match with SOAP Message namespace URI
at org .apache .axis2 .AxisFault .makeFault ( AxisFault .java :430 )
at org .apache .axis2 .transport .TransportUtils .createSOAPMessage ( TransportUtils .java :123 )
at org .apache .axis2 .transport .TransportUtils .createSOAPMessage ( TransportUtils .java :67 )
at org .apache .axis2 .description .OutInAxisOperationClient .handleResponse ( OutInAxisOperation .java :354 )
at org .apache .axis2 .description .OutInAxisOperationClient .send ( OutInAxisOperation .java :417 )
at org .apache .axis2 .description .OutInAxisOperationClient .executeImpl ( OutInAxisOperation .java :229 )
at org .apache .axis2 .client .OperationClient .execute ( OperationClient .java :165 )
at com .teste .wsdl .NfeStatusServico2Stub .nfeStatusServicoNF2 ( NfeStatusServico2Stub .java :206 )
at javaapplication5 .Main .mandarParaReceita ( Main .java :44 )
at javaapplication5 .Main .main ( Main .java :19 )
Caused by : org .apache .axiom .soap .SOAPProcessingException : Transport level information does not match with SOAP Message namespace URI
at org .apache .axis2 .builder .BuilderUtil .validateSOAPVersion ( BuilderUtil .java :768 )
at org .apache .axis2 .builder .SOAPBuilder .processDocument ( SOAPBuilder .java :62 )
at org .apache .axis2 .transport .TransportUtils .createDocumentElement ( TransportUtils .java :197 )
at org .apache .axis2 .transport .TransportUtils .createSOAPMessage ( TransportUtils .java :145 )
at org .apache .axis2 .transport .TransportUtils .createSOAPMessage ( TransportUtils .java :108 )
... 8 more
Orlando.Neto 20 de jul. de 2010
vc gero pelo Axis? se sim qual versão? conserto o endereço do wsdl detro do seu stub?
vcsmetallica 20 de jul. de 2010
Gerai pelo Axis2 - 1.5.1
E mudei as minhas url’s dentro do meu stub.
Tem como vc postar o seu stub para que eu possa comparar?
Orlando.Neto 20 de jul. de 2010
me add no msn que te passo, a classe é muito grande para postar aqui
Orlando.Neto 21 de jul. de 2010
pessoal, alguem poderia verificar para mim se existe o método serialize(XMLStreamWriter) dentro do NfeDadosMsg, se tiver favor enviar para mim por favor
zackcavalera 5 de out. de 2010
pessoal…será que alguem poderia disponibilizar os wsdl pra download ? … os que peguei da SEFAZ-MG não estão funcionando com o wsdl2java do axis2…
ou enviar pro meu email… ou apenas dar uma dica de como fazer… pois os wsdl que peguei da sefaz-sp funcionaram de primeira…
valeu
[ ]'s
touresfinge 12 de abr. de 2011
Ola meu amigo JJSaraiva, Vc postou que consegue consultar a situação da Nfe, vc pode postar o codigo, ou um exemplo de como efetuar a consulta da situação da NFe?
Desde ja meu muito obrigado!!!