def _get_ws(self, afip_ws): """ Method to be inherited """ ws = super(AfipwsConnection, self)._get_ws(afip_ws) if afip_ws == 'wsfe': from pyafipws.wsfev1 import WSFEv1 ws = WSFEv1() elif afip_ws == "wsfex": from pyafipws.wsfexv1 import WSFEXv1 ws = WSFEXv1() elif afip_ws == "wsmtxca": from pyafipws.wsmtx import WSMTXCA ws = WSMTXCA() elif afip_ws == "wscdc": from pyafipws.wscdc import WSCDC ws = WSCDC() elif afip_ws == "ws_sr_padron_a4": from pyafipws.ws_sr_padron import WSSrPadronA4 ws = WSSrPadronA4() if self.type == 'production': ws.H**O = False ws.WSDL = "https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA4?wsdl" elif afip_ws == "ws_sr_constancia_inscripcion": from pyafipws.ws_sr_padron import WSSrPadronA5 ws = WSSrPadronA5() if self.type == 'production': ws.H**O = False ws.WSDL = "https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5?wsdl" return ws
def _get_ws(self, afip_ws): """ Method to be inherited """ _logger.info('Getting ws %s from libraries ' % afip_ws) # por ahora el unico implementado es ws_sr_padron_a4 ws = False if afip_ws == 'ws_sr_padron_a4': from pyafipws.ws_sr_padron import WSSrPadronA4 ws = WSSrPadronA4() elif afip_ws == 'ws_sr_padron_a5': from pyafipws.ws_sr_padron import WSSrPadronA5 ws = WSSrPadronA5() return ws
wrapper = "" # autoridades certificantes (servidores) cacert = "pyafipws/conf/afip_ca_info.crt" # Directorio para archivos temporales (dejar en blanco para usar predeterminado) cache = "pyafipws/cache" ta = wsaa.Autenticar(SERVICIO, CERTIFICADO, CLAVEPRIVADA, wsaa_url, proxy, wrapper, cacert, cache) # utilizar las credenciales: #print wsaa.Token #print wsaa.Sign #wsaa.SetTicketAcceso(ta) # conectar al webservice de padrón: padron = WSSrPadronA5() padron.SetTicketAcceso(ta) padron.Cuit = "20267268038" padron.Conectar( wsdl="https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5?wsdl" ) # if wsaa.Excepcion != '': # print "Excepcion!!: " + wsaa.Excepcion # else: # Obtener Token y Sign de autorización # Token = wsaa.Token # Sign = wsaa.Sign # print "Token: " + Token + "\n" # print "Sign: " + Sign
(Módulo para acceder a los datos de un contribuyente registrado en el Padrón de AFIP). """ __author__ = "Mariano Reingart <*****@*****.**>" __copyright__ = "Copyright (C) 2010-2019 Mariano Reingart" __license__ = "GPL 3.0" import os, sys import pytest from pyafipws.wsaa import WSAA from pyafipws.ws_sr_padron import WSSrPadronA4, WSSrPadronA5, main __WSDL__ = "https://awshomo.afip.gov.ar/sr-padron/webservices/personaServiceA5?wsdl" __obj__ = WSSrPadronA5() __service__ = "ws_sr_padron_a5" CUIT = os.environ["CUIT"] CERT = "reingart.crt" PKEY = "reingart.key" CACHE = "" pytestmark = pytest.mark.vcr @pytest.mark.xfail def test_server_status(auth): """Test de estado de servidores.""" # Estados de servidores respuesta no funciona afip wspa5 = auth