Enviar Correo (Documento emitido)
Introducción
Beneficios del Servicio de Reenvío de Correo Electrónico
Consulta el archivo del documento electronico
Consumo
const url = '/URL_SOAP_EMISION/WSEDOC_CONSULTA.svc?wsdl';
// XML del mensaje SOAP
const soapRequest = `
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<EnviarCorreoDocumentoEmitido>
<Cufe>?</Cufe>
<correocliente>?</correocliente>
<mensaje>?</mensaje>
</EnviarCorreoDocumentoEmitido>
</soapenv:Body>
</soapenv:Envelope>
`;
// Configuración de la solicitud HTTP
const headers = {
'Content-Type': 'text/xml; charset=utf-8', // Tipo de contenido para SOAP
SOAPAction: 'http://tempuri.org/IWSEDOC_CONSULTA/EnviarCorreoDocumentoEmitido', // Acción SOAP específica
};
// Realizar la solicitud con fetch
fetch(url, {
method: 'POST',
headers: headers,
body: soapRequest,
})
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.text();
})
.then((data) => {
console.log('Respuesta SOAP:', data);
})
.catch((error) => {
console.error('Error en la solicitud SOAP:', error.message);
});
Response
Pruebas
Última actualización
¿Te fue útil?