|
|
@ -2,7 +2,7 @@ from ..Servidores import SIGLA_ESTADO |
|
|
from pytrustnfe.xml import sanitize_response |
|
|
from pytrustnfe.xml import sanitize_response |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def nfeInutilizacaoCE(session, xml_send): |
|
|
|
|
|
|
|
|
def nfeInutilizacaoCE(session, xml_send, ambiente): |
|
|
soap = '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body>\ |
|
|
soap = '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body>\ |
|
|
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeInutilizacao4"\ |
|
|
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeInutilizacao4"\ |
|
|
>' + xml_send + '</nfeDadosMsg></Body></Envelope>' |
|
|
>' + xml_send + '</nfeDadosMsg></Body></Envelope>' |
|
|
@ -10,9 +10,14 @@ def nfeInutilizacaoCE(session, xml_send): |
|
|
'SOAPAction': "", |
|
|
'SOAPAction': "", |
|
|
'Content-Type': 'application/soap+xml; charset="utf-8"' |
|
|
'Content-Type': 'application/soap+xml; charset="utf-8"' |
|
|
} |
|
|
} |
|
|
response = session.post( |
|
|
|
|
|
'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
|
|
data=soap, headers=headers) |
|
|
|
|
|
|
|
|
if ambiente == 1: |
|
|
|
|
|
response = session.post( |
|
|
|
|
|
'https://nfe.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
|
|
data=soap, headers=headers) |
|
|
|
|
|
else: |
|
|
|
|
|
response = session.post( |
|
|
|
|
|
'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
|
|
data=soap, headers=headers) |
|
|
response, obj = sanitize_response(response.text) |
|
|
response, obj = sanitize_response(response.text) |
|
|
return { |
|
|
return { |
|
|
'sent_xml': xml_send, |
|
|
'sent_xml': xml_send, |
|
|
|