Browse Source

Debug namespace NFS-e

pull/7/head
Junior Tada 10 years ago
parent
commit
e9123fb49b
  1. 8
      pynfe/processamento/comunicacao.py
  2. 6
      pynfe/utils/webservices.py

8
pynfe/processamento/comunicacao.py

@ -370,7 +370,7 @@ class ComunicacaoNfse(Comunicacao):
# url do serviço
url = self._get_url(autorizador) + NFSE[autorizador.upper()]['AUTORIZACAO']
# gerar
raiz = etree.Element('GerarNfse')
raiz = etree.Element('{}GerarNfse')
# cabecalho
raiz.append(self._cabecalho_soap())
dados = etree.SubElement(raiz, 'nfseDadosMsg')
@ -441,6 +441,7 @@ class ComunicacaoNfse(Comunicacao):
certificadoA1 = CertificadoA1(self.certificado)
chave, cert = certificadoA1.separar_arquivo(self.certificado_senha, caminho=True)
chave_cert = (cert, chave)
# Abre a conexão HTTPS
try:
xml_declaration='<?xml version="1.0" encoding="utf-8"?>'
@ -448,6 +449,11 @@ class ComunicacaoNfse(Comunicacao):
xml = etree.tostring(xml, encoding='unicode', pretty_print=False).replace('\n','').replace('ns0:','').replace(':ns0','')
xml = xml_declaration + xml
print (url)
print (xml)
import ipdb
ipdb.set_trace()
# Faz o request com o servidor
result = requests.post(url, xml, headers=self._post_header(), cert=chave_cert, verify=False)
result.encoding='utf-8'

6
pynfe/utils/webservices.py

@ -429,14 +429,14 @@ NFSE = {
'STATUS':'',
'AUTORIZACAO':'GerarNfse',
'CANCELAR':'CancelarNfse',
'CONSULTA_RPS':'ConsultarNfsePorRps',
'CONSULTA_RPS':'consultarNfsePorRps',
'CONSULTA_FAIXA':'ConsultarNfseFaixa',
'CONSULTA_SERVICO':'ConsultarNfseServicoPrestado',
'CONSULTA_SERVICO_TOMADO':'ConsultarNfseServicoTomado',
'SUBSTITUIR':'SubstituirNfse',
'HTTPS':'http://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS?wsdl',
'HOMOLOGACAO':'http://e-gov.betha.com.br/e-nota-contribuinte-test-ws/nfseWS?'
#'HOMOLOGACAO':'http://e-gov.betha.com.br/e-nota-contribuinte-test-ws/nfseWS?wsdl'
'HOMOLOGACAO':'http://e-gov.betha.com.br/e-nota-contribuinte-test-ws/'
#'HOMOLOGACAO':'http://e-gov.betha.com.br/e-nota-contribuinte-test-ws/nfseWS?wsdl/'
},
#
'GINFES':{

Loading…
Cancel
Save