# andresramos/arsoftware.cfdi.descargamasiva architecture

> Architecture diagram of the GitHub repository andresramos/arsoftware.cfdi.descargamasiva, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andresramos/arsoftware.cfdi.descargamasiva
- Repository: https://github.com/andresramos/arsoftware.cfdi.descargamasiva

## Overview

This is a .NET library for retrieving CFDI packages in bulk from Mexico’s SAT SOAP services. The documented workflow obtains an access token, submits a download request, checks its status until packages are ready, then downloads package contents. The graph preserves those domain stages and the shared SOAP transport/signing layer. Service-to-transport calls are visible in excerpts; the staged user workflow and SAT integration are documented in the README. Other implementation details are not inferred from unsampled files.

Main entry points: [`src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs) (Verify status), [`src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs) (Submit request), [`src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs) (Download packages), [`src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_registration["DI registration"]
end

subgraph group_stages["Download stages"]
  node_auth["Authentication"]
  node_submit["Submit request"]
  node_verify["Verify status"]
  node_download["Download packages<br/>[DescargaService.cs]"]
end

subgraph group_transport["SOAP and security"]
  node_soap["HTTP SOAP client<br/>[HttpSoapClient.cs]"]
  node_signing["XML signing<br/>[SignedXmlHelper.cs]"]
  node_soaphelper["SOAP helper"]
  node_certhelper["Certificate helper"]
  node_endpoints["SAT endpoints"]
  node_namespaces["SOAP namespaces"]
end

subgraph group_contracts["Request and response data"]
  node_models["Typed requests<br/>[Models]"]
  node_results["Typed results<br/>[Models]"]
  node_token["Access token<br/>[AccessToken.cs]"]
  node_soapresult["SOAP response"]
  node_enums["Domain codes<br/>[Enumerations]"]
  node_invalid["Invalid response error"]
end

node_consumer(("Library consumer"))
node_sat{{"SAT SOAP services"}}

node_consumer -->|"registers services"| node_registration
node_consumer -->|"requests token"| node_auth
node_consumer -->|"submits criteria"| node_submit
node_consumer -->|"checks status"| node_verify
node_consumer -->|"fetches packages"| node_download
node_consumer -->|"loads certificate"| node_certhelper
node_auth -->|"sends SOAP"| node_soap
node_submit -->|"sends SOAP"| node_soap
node_verify -->|"sends SOAP"| node_soap
node_download -->|"sends SOAP"| node_soap
node_auth -->|"signs authentication"| node_signing
node_submit -->|"signs envelope"| node_signing
node_verify -->|"signs envelope"| node_signing
node_download -->|"signs envelope"| node_signing
node_auth -->|"uses endpoint"| node_endpoints
node_submit -->|"uses endpoint"| node_endpoints
node_verify -->|"uses endpoint"| node_endpoints
node_download -->|"uses endpoint"| node_endpoints
node_auth -->|"builds SOAP XML"| node_namespaces
node_submit -->|"builds SOAP XML"| node_namespaces
node_verify -->|"builds SOAP XML"| node_namespaces
node_download -->|"builds SOAP XML"| node_namespaces
node_auth -->|"accepts request"| node_models
node_submit -->|"accepts request"| node_models
node_verify -->|"accepts request"| node_models
node_download -->|"accepts request"| node_models
node_auth -->|"parses response"| node_soapresult
node_submit -->|"parses response"| node_soapresult
node_verify -->|"parses response"| node_soapresult
node_download -->|"parses response"| node_soapresult
node_auth -->|"returns result"| node_results
node_submit -->|"returns result"| node_results
node_verify -->|"returns result"| node_results
node_download -->|"returns result"| node_results
node_soap -->|"creates response"| node_soapresult
node_soap -->|"formats authorization"| node_token
node_signing -->|"resolves IDs"| node_namespaces
node_soap -->|"exchanges SOAP"| node_sat
node_auth -->|"returns token"| node_token
node_submit -->|"provides request ID"| node_verify
node_verify -->|"provides package IDs"| node_download
node_download -->|"returns package data"| node_consumer
node_submit -->|"uses request types"| node_enums
node_verify -->|"interprets status"| node_enums
node_submit -->|"rejects malformed response"| node_invalid
node_verify -->|"rejects malformed response"| node_invalid
node_download -->|"rejects malformed response"| node_invalid

click node_registration "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/ConfigureServices.cs"
click node_auth "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs"
click node_submit "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs"
click node_verify "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs"
click node_download "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs"
click node_soap "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/HttpSoapClient.cs"
click node_signing "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SignedXmlHelper.cs"
click node_soaphelper "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SoapRequestHelper.cs"
click node_certhelper "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/X509Certificate2Helper.cs"
click node_endpoints "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaWebServiceUrls.cs"
click node_namespaces "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaNamespaces.cs"
click node_models "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Models"
click node_results "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Models"
click node_token "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Models/AccessToken.cs"
click node_soapresult "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Models/SoapRequestResult.cs"
click node_enums "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Enumerations"
click node_invalid "https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Exceptions/InvalidResponseContentException.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_registration toneBlue
class node_auth,node_submit,node_verify,node_download toneAmber
class node_soap,node_signing,node_soaphelper,node_certhelper,node_endpoints,node_namespaces toneMint
class node_models,node_results,node_token,node_soapresult,node_enums,node_invalid toneRose
class node_consumer,node_sat toneIndigo
```

## Components

### Public API

- [DI registration](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/ConfigureServices.cs): `src/ARSoftware.Cfdi.DescargaMasiva/ConfigureServices.cs`

### Download stages

- [Authentication](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`
- [Submit request](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`
- [Verify status](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`
- [Download packages](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`

### SOAP and security

- [HTTP SOAP client](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Services/HttpSoapClient.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Services/HttpSoapClient.cs`
- [XML signing](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SignedXmlHelper.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SignedXmlHelper.cs`
- [SOAP helper](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SoapRequestHelper.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SoapRequestHelper.cs`
- [Certificate helper](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Helpers/X509Certificate2Helper.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Helpers/X509Certificate2Helper.cs`
- [SAT endpoints](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaWebServiceUrls.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaWebServiceUrls.cs`
- [SOAP namespaces](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaNamespaces.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Constants/CfdiDescargaMasivaNamespaces.cs`

### Request and response data

- [Typed requests](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Models): `src/ARSoftware.Cfdi.DescargaMasiva/Models`
- [Typed results](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Models): `src/ARSoftware.Cfdi.DescargaMasiva/Models`
- [Access token](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Models/AccessToken.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Models/AccessToken.cs`
- [SOAP response](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Models/SoapRequestResult.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Models/SoapRequestResult.cs`
- [Domain codes](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/tree/master/src/ARSoftware.Cfdi.DescargaMasiva/Enumerations): `src/ARSoftware.Cfdi.DescargaMasiva/Enumerations`
- [Invalid response error](https://github.com/andresramos/arsoftware.cfdi.descargamasiva/blob/master/src/ARSoftware.Cfdi.DescargaMasiva/Exceptions/InvalidResponseContentException.cs): `src/ARSoftware.Cfdi.DescargaMasiva/Exceptions/InvalidResponseContentException.cs`

### Other components

- **Library consumer**
- **SAT SOAP services**

## Connections

- Library consumer → DI registration: registers services (evidence: `README.md`)
- Library consumer → Authentication: requests token (evidence: `README.md`)
- Library consumer → Submit request: submits criteria (evidence: `README.md`)
- Library consumer → Verify status: checks status (evidence: `README.md`)
- Library consumer → Download packages: fetches packages (evidence: `README.md`)
- Library consumer → Certificate helper: loads certificate (evidence: `README.md`)
- Authentication → HTTP SOAP client: sends SOAP (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → HTTP SOAP client: sends SOAP (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → HTTP SOAP client: sends SOAP (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → HTTP SOAP client: sends SOAP (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → XML signing: signs authentication (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → XML signing: signs envelope (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → XML signing: signs envelope (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → XML signing: signs envelope (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → SAT endpoints: uses endpoint (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → SAT endpoints: uses endpoint (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → SAT endpoints: uses endpoint (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → SAT endpoints: uses endpoint (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → SOAP namespaces: builds SOAP XML (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → SOAP namespaces: builds SOAP XML (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → SOAP namespaces: builds SOAP XML (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → SOAP namespaces: builds SOAP XML (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → Typed requests: accepts request (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → Typed requests: accepts request (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → Typed requests: accepts request (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → Typed requests: accepts request (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → SOAP response: parses response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → SOAP response: parses response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → SOAP response: parses response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → SOAP response: parses response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- Authentication → Typed results: returns result (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/AutenticacionService.cs`)
- Submit request → Typed results: returns result (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → Typed results: returns result (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → Typed results: returns result (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
- HTTP SOAP client → SOAP response: creates response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/HttpSoapClient.cs`)
- HTTP SOAP client → Access token: formats authorization (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Models/AccessToken.cs`)
- XML signing → SOAP namespaces: resolves IDs (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Helpers/SignedXmlHelper.cs`)
- HTTP SOAP client → SAT SOAP services: exchanges SOAP (evidence: `README.md`)
- Authentication → Access token: returns token (evidence: `README.md`)
- Submit request → Verify status: provides request ID (evidence: `README.md`)
- Verify status → Download packages: provides package IDs (evidence: `README.md`)
- Download packages → Library consumer: returns package data (evidence: `README.md`)
- Submit request → Domain codes: uses request types (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → Domain codes: interprets status (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Submit request → Invalid response error: rejects malformed response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/SolicitudService.cs`)
- Verify status → Invalid response error: rejects malformed response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/VerificacionService.cs`)
- Download packages → Invalid response error: rejects malformed response (evidence: `src/ARSoftware.Cfdi.DescargaMasiva/Services/DescargaService.cs`)
