Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
695 blopes 1
package nfe;
2
 
3
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
4
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
5
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
6
import br.com.swconsultoria.nfe.exception.NfeException;
7
import br.com.swconsultoria.nfe.schema.envcce.TEnvEvento;
8
import br.com.swconsultoria.nfe.schema.envcce.TRetEnvEvento;
9
import br.com.swconsultoria.nfe.util.XmlNfeUtil;
10
 
11
import javax.xml.bind.JAXBException;
12
 
13
/**
14
 * @author Samuel Oliveira - samuel@swconsultoria.com.br Data: 28/09/2017 - 11:11
15
 */
16
class CartaCorrecao {
17
 
18
        static TRetEnvEvento eventoCCe(ConfiguracoesNfe config, TEnvEvento enviEvento, boolean valida)
19
                        throws NfeException {
20
 
21
                try {
22
 
23
                        String xml = XmlNfeUtil.objectToXml(enviEvento, config.getEncode());
24
                        xml = xml.replaceAll(" xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\"", "");
25
                        xml = xml.replaceAll("<evento v", "<evento xmlns=\"http://www.portalfiscal.inf.br/nfe\" v");
26
 
27
                        xml = Eventos.enviarEvento(config, xml, ServicosEnum.CCE, valida,true, DocumentoEnum.NFE);
28
 
29
                        return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);
30
 
31
                } catch (JAXBException e) {
32
                        throw new NfeException(e.getMessage(),e);
33
                }
34
 
35
        }
36
}