← Back to services & tools

ArcaSim active

ARCA's web services, for developing and testing without ARCA, Argentina's tax authority. An application that invoices uses its real ARCA client against ArcaSim during development, in its tests and in demos. Going to production changes two addresses and the certificate, not the code.

C#.NET 8ASP.NET Core SOAPPostgreSQLDocker xUnitTestcontainers

About ARCA

ArcaSim is not related to ARCA. The taxpayers are fictitious, the CAEs it grants have no tax validity and its access tickets only work against ArcaSim. What does come from ARCA are the WSDL files, the error codes and the texts, taken from its public documentation and from real responses. The panel is in Spanish.

ArcaSim's panel: environment, manual version and clock; fictitious taxpayers with their points of sale; certificates and authorizations; failures on demand; exchange rates, and the table of issued vouchers with their CAE.
The panel. What WSASS does at ARCA (certificates and authorizations), ArcaSim does here, and it also moves the clock and causes failures.
52of ARCA's 53 current web services, with their official WSDL files
byte for bytethe same as a real ARCA response, except the CAE number
789tests, with the client generated from the official WSDL, every service against its WSDL and real PostgreSQL

What it is for

Invoicing in Argentina goes through ARCA: every invoice needs its authorization code (CAE), and to get it an application signs a request with a digital certificate, gets an access ticket and only then calls the electronic invoicing service. Testing that against ARCA takes a test certificate obtained with the company’s tax credentials, and even then the things most worth testing cannot be caused: ARCA not answering, rejecting with a specific code, or the answer getting lost after the CAE was granted.

The usual way out is a simulator written inside each application, which returns a made-up CAE and never quite matches the real protocol. ArcaSim does the opposite: the application uses, from day one, the same client it will invoice with in production, and on the other side answers a service that speaks exactly like ARCA.

Endpoints only

ArcaSim is used the way ARCA is: two URLs and a certificate. Nothing has to be loaded first. It accepts any certificate with a CUIT in its DN, whether the one WSASS issued for homologación or a self-signed one made with openssl, and the taxpayer and the point of sale are created the first time they are used. That is why it works from any language and with any ARCA client: the repository has an example that gets a CAE with openssl and curl alone, and a full reference of the operations, the errors and the test scenarios.

docker run -d -p 7080:8080 -v arcasim-data:/data ghcr.io/federicomoroz/arcasim

Whoever needs to reproduce ARCA’s registration errors (an unauthorized certificate, a point of sale that is not for web services) switches it to strict mode.

Swapping ArcaSim for ARCA

Five-step animation: the application signs the request and gets its access ticket from ArcaSim; it asks for the CAE of an invoice B; the panel causes failures; the clock expires the ticket or crosses 01/12/2026; for production, the same calls go to ARCA by changing two addresses and the certificate.
Nothing changes on the application's side: the client, the calls and the error handling are the same against ArcaSim and against ARCA.

To invoice, an application needs two services:

The repository also ships Arca.Client, the client applications use. It knows nothing about ArcaSim: it signs the request, keeps the ticket until it expires, builds the vouchers and tells a rejection, which gets fixed and sent again, from a failure worth retrying.

Not just electronic invoicing

ARCA has more than fifty web services, and a company rarely uses WSFEv1 alone: an exporter asks for its CAEs through WSFEXv1, a grain elevator issues waybills through WSCPE and settles through WSLPG, a bank checks debts through SUD, a bonded warehouse reports its movements to customs. ArcaSim answers 52 of the 53 current services; the missing one has no published contract.

Each one on its path, with its official WSDL and in its server’s dialect: .NET ASMX, Apache Axis2, CXF, JAX-WS or Spring-WS. They refuse a ticket with their own codes and texts, and they do not return sample data: they apply their manual’s rules over what ArcaSim keeps.

The registries ARCA fills outside its web services, such as debts, fake invoices or customs declarations, start with fictitious data, and are replaced through the admin API before a test.

The answer that gets lost

Six-step animation: the client asks for the last number and requests the CAE of 42; ARCA grants and stores it but the connection drops; a blind resend would get 10016; the client looks up 42 with FECompConsultar and recovers the CAE without duplicating anything.
The procedure ARCA's manual prescribes for communication errors, caused on demand from the panel.

ARCA is not idempotent: if the answer to a CAE request gets lost and the application sends the same voucher again, ARCA rejects it because that number is already issued. Against the real ARCA this is almost impossible to cause. ArcaSim causes it on demand: it grants the CAE, stores it and drops the connection before answering. Arca.Client handles it as the manual says, looking the voucher up before retrying.

The panel also takes the service down, adds a delay, rejects the next voucher with a chosen code and moves the clock: expire the ticket, leave the allowed date range or cross 01/12/2026, when the receiver’s VAT condition becomes mandatory.

Saturation and bottlenecks

The panel's traffic section: two saturation meters, one per service. WSFEv1's reads 58.3 %: of 12 requests in the last minute, 7 refused, 805 ms on average and 1,281 ms at p95, with two served at once, 400 ms each and three places in the queue.
Twelve requests at once, with two served at a time and three places in the queue: five go through, seven get a 503, and the meter shows it. The panel is in Spanish.

A saturated service slows down or stops answering. ArcaSim reproduces that on its same URLs, with a requests-per-minute limit, a capacity (how many it serves at once and how long each takes) and a queue. What does not fit gets HTTP 503, like a saturated load balancer, and the client has to retry. The meter, ported from Rate Guardian’s, shows which share of the last minute’s requests was turned away, and a live log shows every ticket, every CAE and every rejection.

The same as ARCA, checked

Level What matches How it is checked
Contract Paths, ARCA’s WSDL files, operations, namespaces, SOAP 1.1 and 1.2 The client dotnet-svcutil generates from ARCA’s WSDL, untouched, asks ArcaSim for a CAE over SOAP 1.1 and 1.2
Bytes One line with the FEHeaderInfo header, an empty <CAE />, amounts without trailing zeros, the literal NULL for empty dates; Apache Axis faults in WSAA An approved CAE and a rejected resend match recorded ARCA responses byte for byte, except the CAE number
Errors The manual’s codes, and the real texts where they are known A coverage table generated from the code
Behavior Numbering per CUIT, point of sale and type; a batch stops at the first rejection; 12-hour ticket Scenario tests
The other services Every answer valid against ARCA’s WSDL; the refused ticket with each service’s codes and texts A test per operation of every service, plus each one’s main flows

Used by

Fornu's invoicing gets its CAEs with Arca.Client. While it is developed it talks to ArcaSim, and its tests walk the real path: a CAE granted and taken back with a credit note, ARCA down with the invoice waiting until it is back, a lost answer found on ARCA without asking for a second number, and A and B invoices with their VAT.

For engineers

Before any code, the whole public ARCA API was studied: WSAA, WSFEv1 and its 496 validations, every other service with its codes, the catalog and the regulations in force, with the official WSDL files and real responses. It is in the repository, in docs/arca/ (Spanish).

docker run -d -p 7080:8080 ghcr.io/federicomoroz/arcasim   # the published image, in memory
docker compose up -d                                       # from the repository, with PostgreSQL
dotnet test