This commit is contained in:
2025-10-05 17:33:54 -06:00
parent cf181023bd
commit 8b151a6fe9
4 changed files with 57 additions and 70 deletions

View File

@@ -70,6 +70,13 @@ async def consume_ws_get_partida(**kwargs):
raise Exception("No se recibió respuesta del servicio SOAP")
if soap_error(soap_response):
document_response = await partida_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=f"vu_PT_{pedimento_app}_{partida.get('numero', '')}_ERROR.xml",
document_type=10,
)
raise Exception("Error en la respuesta del servicio SOAP")
logger.info("Respuesta SOAP exitosa, enviando documento")
@@ -77,23 +84,14 @@ async def consume_ws_get_partida(**kwargs):
# Enviar documento
_file_name = f"vu_PT_{pedimento_app}_{partida.get('numero', '')}.xml"
try:
if soap_error(soap_response):
document_response = await partida_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=f"vu_PT_{pedimento_app}_{partida.get('numero', '')}_ERROR.xml",
document_type=10,
)
raise Exception("Error en la respuesta del servicio SOAP")
else:
document_response = await partida_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=_file_name,
document_type=1,
)
document_response = await partida_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=_file_name,
document_type=1,
)
except Exception as e:
logger.error(f"Error detectado en la respuesta SOAP: {str(e)}")