How sartrebrasil/nfe works
This is a Java library for creating, signing, validating, and transmitting Brazilian electronic fiscal documents (NF-e/NFC-e, CT-e, and MDF-e). The documented workflow is: configure environment and certificates, construct a document using schema-shaped Java classes, then use the version-specific WSFacade to sign, validate, transmit, and receive a Java response. The tree also shows document-key parsing, shared XML serialization, validation, and mutual-TLS/HTTP support. Facade workflow edges reflect the README; unsampled implementation details and links between separate document operations are intentionally omitted.
Main entry points: webservices/WSFacade.java NF-e web services · DFConfig.java Environment and credentials · webservices/WSFacade.java CT-e web services · webservices/WSFacade.java MDF-e web services
Components 22
Configuration and standards
- Environment and credentials
src/main/java/com/fincatto/documentofiscal/DFConfig.java - Document standards
src/main/java/com/fincatto/documentofiscal/DFModelo.java
Fiscal documents
- NF-e / NFC-e model
src/main/java/com/fincatto/documentofiscal/nfe400 - CT-e model
src/main/java/com/fincatto/documentofiscal/cte300/classes/nota - MDF-e model
src/main/java/com/fincatto/documentofiscal/mdfe3 - NF-e key parser
src/main/java/com/fincatto/documentofiscal/nfe310/parsers/NotaFiscalChaveParser.java - CT-e key parser
src/main/java/com/fincatto/documentofiscal/cte300/parsers/CTChaveParser.java - MDF-e key parser
src/main/java/com/fincatto/documentofiscal/mdfe3/classes/parsers/MDFChaveParser.java
SEFAZ operations
- NF-e web services
src/main/java/com/fincatto/documentofiscal/nfe400/webservices/WSFacade.java - CT-e web services
src/main/java/com/fincatto/documentofiscal/cte400/webservices/WSFacade.java - MDF-e web services
src/main/java/com/fincatto/documentofiscal/mdfe3/webservices/WSFacade.java - NF-e distribution
src/main/java/com/fincatto/documentofiscal/nfe/webservices/distribuicao/WSDistribuicaoNFe.java - CT-e distribution
src/main/java/com/fincatto/documentofiscal/cte/webservices/distribuicao/WSDistribuicaoCTe.java - MDF-e distribution
src/main/java/com/fincatto/documentofiscal/mdfe/webservices/distribuicao/WSDistribuicaoMDFe.java
Transport and security
- TLS context
src/main/java/com/fincatto/documentofiscal/utils/DFSocketFactory.java - Certificate key manager
src/main/java/com/fincatto/documentofiscal/utils/DFKeyManager.java - SOAP HTTP client
src/main/java/com/fincatto/documentofiscal/utils/DFHttpClient.java
Shared internals
- XML serialization
src/main/java/com/fincatto/documentofiscal/DFBase.java - XML transformers
src/main/java/com/fincatto/documentofiscal/transformers/DFRegistryMatcher.java - Field validation
src/main/java/com/fincatto/documentofiscal/validadores/DFStringValidador.java
Other components
- Library user
- SEFAZ services
Connections 22
- Library user → Environment and credentials: configures
- Library user → NF-e / NFC-e model: builds
- Library user → CT-e model: builds
- Library user → MDF-e model: builds
- Library user → NF-e web services: invokes
- Library user → CT-e web services: invokes
- Library user → MDF-e web services: invokes
- NF-e web services → SEFAZ services: transmits to
- CT-e web services → SEFAZ services: transmits to
- MDF-e web services → SEFAZ services: transmits to
- NF-e web services → NF-e distribution: dispatches distribution
src/main/java/com/fincatto/documentofiscal/nfe400/webservices/WSFacade.java - SEFAZ services → NF-e web services: returns response
- SEFAZ services → CT-e web services: returns response
- SEFAZ services → MDF-e web services: returns response
- Environment and credentials → TLS context: provides credentials
src/main/java/com/fincatto/documentofiscal/utils/DFSocketFactory.java - TLS context → Certificate key manager: creates
src/main/java/com/fincatto/documentofiscal/utils/DFSocketFactory.java - SOAP HTTP client → Environment and credentials: reads timeouts
src/main/java/com/fincatto/documentofiscal/utils/DFHttpClient.java - SOAP HTTP client → TLS context: uses TLS
src/main/java/com/fincatto/documentofiscal/utils/DFHttpClient.java - NF-e key parser → Document standards: looks up model
src/main/java/com/fincatto/documentofiscal/nfe310/parsers/NotaFiscalChaveParser.java - CT-e key parser → Document standards: looks up model
src/main/java/com/fincatto/documentofiscal/cte300/parsers/CTChaveParser.java - MDF-e key parser → Document standards: looks up model
src/main/java/com/fincatto/documentofiscal/mdfe3/classes/parsers/MDFChaveParser.java - XML serialization → XML transformers: uses transformers
src/main/java/com/fincatto/documentofiscal/DFBase.java