Olá amigos!
Estou com uma rotina para NFeS é quando vou gerar o XML da RPS ele me dá o seguinte erro!
Error at line 55 of GLOBAL Procedure GerarXmlLoteRps Process.
XMLSave FUNCTION called.
The XML document has several roots, it cannot be saved.
Project : NFES_WS_CLIENT
WL call:
Process of 'GLOBAL Procedure GerarXmlLoteRps' (COL_GlobalProcedures.GerarXmlLoteRps), line 55, thread 0
'XMLSave' FUNCTION, syntax 1
What happened?
The XML document has several roots, it cannot be saved.
Error code: 40074
Level: fatal Error (EL_FATAL)
Dump of the Error of 'wd200xml.dll' module (20.0.31.0).
Debugging information:
FONCTION (4,44)
Additional Information:
EIT_PILEWL :
GLOBAL Procedure GerarXmlLoteRps (COL_GlobalProcedures.GerarXmlLoteRps), line 55
EIT_DATEHEURE : 18/08/2015 12:36:10
o principal é isto aqui que ainda não entendi muito bem
olhe como fica meu trecho de código
XMLRPS is XMLDocument <Description="ReqEnvioLoteRPS.ReqEnvioLoteRPS">
NameRPS is XMLNamespace
nNodeRPS is dynamic xmlNode
nNodeRPS = XMLRPS.Lote
XMLRPS..Encoding = "UTF-8"
XMLRPS..Version = "1.0"
NameRPS..Name = "xsi"
NameRPS..URI = "http://www.issdigitalbel.com.br/WsNFe2/LoteRps.jws?wsdl"
Add(nNodeRPS..NamespaceDeclared, NameRPS)
nNodeRPS:noNamespaceSchemaLocation..Value = "ReqEnvioLoteRPS.xsd"
nNodeRPS:noNamespaceSchemaLocation..Namespace = NameRPS
HReadSeek(rps,CodRps,nRps)
IF HFound(rps) = True THEN
XMLRPS.Cabecalho.CodCidade = rps.CidadeTomador
XMLRPS.Cabecalho.CPFCNPJRemetente = rps.CpfCnpjTomador
XMLRPS.Cabecalho.RazaoSocialRemetente = rps.RazaoSocialTomador
XMLRPS.Cabecalho.transacao = "true"
XMLRPS.Cabecalho.dtInicio = DateToString(DateSys(),"YYYY-MM-DD")
XMLRPS.Cabecalho.dtFim = DateToString(DateSys(),"YYYY-MM-DD")
XMLRPS.Cabecalho.QtdRPS = ""
XMLRPS.Cabecalho.ValorTotalServicos = Val(rps.ValorINSS)
XMLRPS.Cabecalho.ValorTotalDeducoes = Val(rps.ValorPis)
XMLRPS.Cabecalho.Versao = 1
XMLRPS.Cabecalho.MetodoEnvio = "WS"
XMLRPS.Lote:Id = rps.NumeroLote
XMLRPS.Lote.RPS:Id = rps.NumeroRps
XMLRPS.Lote.RPS.Assinatura = rps.Assinatura
XMLRPS.Lote.RPS.InscricaoMunicipalPrestador = rps.InscricaoMunicipalPrestador
XMLRPS.Lote.RPS.RazaoSocialPrestador = rps.RazaoSocialPrestador
XMLRPS.Lote.RPS.TipoRPS = rps.TipoRps
XMLRPS.Lote.RPS.SerieRPS = rps.SerieRps
XMLRPS.Lote.RPS.NumeroRPS = rps.NumeroRps
XMLRPS.Lote.RPS.DataEmissaoRPS = rps.DataEmissaoRps
XMLSave(XMLRPS, gPastaEnvio+[fSep()]+nRps+"_assinc.xml")
ShellExecute( gPastaEnvio+[fSep()]+nRps+"_assinc.xml")
END
agradeço a atenção de todos!
--
Analista de Sistemas Jr
Assessor de Comunicação
Fotografo nas horas Vagas
Pai da Alícia e Marido da Andréa <3