3
People I used windows XSD application to generate classes for NFE, it worked 100%, now I need to use these classes to fill with data of the tax notes that will be imported, I’m doing this:
TNFe nfe = null;
XmlSerializer xmls = new XmlSerializer(typeof(TNFe));
FileStream fs = new FileStream(@"C:\Arquivos\XML_7446_1.xml", FileMode.Open);
nfe = (TNFe)xmls.Deserialize(fs);
Tnfe is the class that is generated by XSD, read here in another topic that use the first tag as classe
to complete by this procedure above.
If anyone can help me, he makes a mistake like this:
"Error in XML document (1,2)"
the first line of the note is like this:
<?xml version="1.0" encoding="utf-8" ?><nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="3.10"><NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe versao="3.10" Id="NFe31150608405781000106550010000631581000560951">
I never used, once again a friend was with this problem and it was his XML that was wrong and generated this error.
– Marconi
How is your Tnfe? class and xml file?
– Marco Souza
This error is xml line 1 position 2.
– Marco Souza
Put the XML file here
– Tiedt Tech
I’ve already edited with the data, I’m learning to use here
– Jester Andrade