sandrini 29 de mar. de 2010
Acredito que seja falha de schema.
Você está consultando uma msg com versão 2.00, e sua msg está começando com nfeDadosMsg
Se você olhar o manual a mensagem de consulta começa já com consStatServ sem nfeDadosMsg.
Thyaggo 29 de mar. de 2010
Olá Sandrini!
Bom o erro não está em como o XML é montado (creio eu), pois ele segue a mesma forma que é descrita na página do serviço web, da seguinte forma:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
<versaoDados>string</versaoDados>
<cUF>string</cUF>
</nfeCabecMsg>
</soap12:Header>
<soap12:Body>
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">xml</nfeDadosMsg>
</soap12:Body>
</soap12:Envelope>
O XML montado está da mesma forma que o exemplo do XML da página do serviço.
nessinhavos 29 de mar. de 2010
Olá Thyaggo ,
Você já tentou sem o prefixo ns1?
Acredito que o uso desse prefixo pode interferir, já que o manual diz “Não é permitida a utilização de prefixos de namespace. Essa restrição visa otimizar o
tamanho do arquivo XML”
[ ]'s
Thyaggo 29 de mar. de 2010
Olá Nessin!
O XML que meu programa gera para a SEFAZ Virtual do RS é bem parecido e com o ns1 e não dá problema, ele é assim:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header>
<ns1:nfeCabecMsg xmlns:ns1="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" soapenv:mustUnderstand="false">
<ns1:cUF>25</ns1:cUF>
<ns1:versaoDados>2.00</ns1:versaoDados>
</ns1:nfeCabecMsg>
</soapenv:Header>
<soapenv:Body>
<ns1:nfeDadosMsg xmlns:ns1="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
<consStatServ xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
<tpAmb>2</tpAmb>
<cUF>25</cUF>
<xServ>STATUS</xServ>
</consStatServ>
</ns1:nfeDadosMsg>
</soapenv:Body>
</soapenv:Envelope>
Ainda não consigo entender o erro que dá na Bahia.
danillo54 8 de jun. de 2010
Estou tendo o mesmo problema porém com o webservice do estado de Goiás, tenstando com o de RS e SP funciona :shock:
Alguem consegui resolver??
danillo54 9 de jun. de 2010
Consegui resolver o problema basta remover o Namespace Prefix = ns1
jonatascaberlon 12 de jul. de 2010
Olá pessoal.
Estou com o mesmo problema, porém não sei como retirar essas namespaces, uma vez que, ao colocar o “xml” dentro do nfeDadosMsg, o próprio NetBeans está fazendo isso.
Att,
Jonatas
Orlando.Neto 19 de jul. de 2010
pessoal olha como meu xml está ficando.
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv= "http://www.w3.org/2003/05/soap-envelope" >
<soapenv:Header>
<ns1:nfeCabecMsg xmlns:ns1= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2"
soapenv:mustUnderstand= "false" >
<cUF xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" >
31</cUF>
<versaoDados xmlns= "http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" >
2.00</versaoDados>
</ns1:nfeCabecMsg>
</soapenv:Header>
<soapenv:Body>
<ns1:nfeDadosMsg xmlns:ns1= "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>
</ns1:nfeDadosMsg>
</soapenv:Body>
</soapenv:Envelope>
mas mesmo assim está dando erro quando serializa
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 )
alguma idéia?