You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fake implementation for testing, mimicking government servers (WSDL SOAP based)
This idea should implement a standalone webserver with a SOAP XML interface, so new clients could use it to test implementations without using real world AFIP servers.
Also, to avoid flaky tests or recording XML requests and responses, this could be used in integration & end to end tests.
See server.py for an example using the SOAP library used in this project.
Major AFIP Web Services to simulate:
WSAA (authentication and authorization)
WSFEv1 (simple electronic invoice, for most customers)
WSMTXCA (electronic invoice with details for large tax contributors)
WSFEXv1 (electronic invoice for foreign trade)
WSBFEv1 (electronic invoice for tax bonous)
Methods to implement:
Query and retrieve last invoice number (CompUltConsultar)
Query and retrieve an invoice (CompConsultar)
Authorize an invoice (SolicitarCAE)
This could be done also with django or flask.
Example web2py-app for a Proof of Concept
For a quick initial ticket PoC, a minimal webservice using python http.server to respond with a basic XML response for the URL http://localhost/wsfev1/service.asmx.
Sample XML response for POST with header SOAPAction: "http://ar.gov.afip.dif.FEV1/FECompUltimoAutorizado":
To identify potential issues in the provided SOAP response, here are some common areas to investigate:
Check if the SOAP Envelope is properly formed: The soap:Envelope should have a matching opening and closing tag.
Namespace declarations: Ensure the namespaces (xmlns) are accurate and match the service specifications.
PtoVta (Point of Sale): Ensure the point of sale (3) is valid and correctly configured.
Fake implementation for testing, mimicking government servers (WSDL SOAP based)
This idea should implement a standalone webserver with a SOAP XML interface, so new clients could use it to test implementations without using real world AFIP servers.
Also, to avoid flaky tests or recording XML requests and responses, this could be used in integration & end to end tests.
See server.py for an example using the SOAP library used in this project.
Major AFIP Web Services to simulate:
Methods to implement:
This could be done also with django or flask.
Example web2py-app for a Proof of Concept
For a quick initial ticket PoC, a minimal webservice using python http.server to respond with a basic XML response for the URL
http://localhost/wsfev1/service.asmx
.Sample XML response for POST with header
SOAPAction: "http://ar.gov.afip.dif.FEV1/FECompUltimoAutorizado"
:Sample XML response for POST with header
SOAPAction: "http://ar.gov.afip.dif.FEV1/FECAESolicitar"
:For more info about http module: https://pymotw.com/3/http.server/
The text was updated successfully, but these errors were encountered: