Пример #1
0
        public string GenerateSoapRequestEnvelopeXmlContent(VerificacionRequest verificacionRequest, X509Certificate2 certificate)
        {
            var xmlDocument = new XmlDocument();

            var envelopElement = xmlDocument.CreateElement(CfdiDescargaMasivaNamespaces.S11Prefix, "Envelope", CfdiDescargaMasivaNamespaces.S11NamespaceUrl);

            envelopElement.SetAttribute($"xmlns:{CfdiDescargaMasivaNamespaces.S11Prefix}", CfdiDescargaMasivaNamespaces.S11NamespaceUrl);
            envelopElement.SetAttribute($"xmlns:{CfdiDescargaMasivaNamespaces.DesPrefix}", CfdiDescargaMasivaNamespaces.DesNamespaceUrl);
            envelopElement.SetAttribute($"xmlns:{CfdiDescargaMasivaNamespaces.DsPrefix}", CfdiDescargaMasivaNamespaces.DsNamespaceUrl);
            xmlDocument.AppendChild(envelopElement);

            var headerElement = xmlDocument.CreateElement(CfdiDescargaMasivaNamespaces.S11Prefix, "Header", CfdiDescargaMasivaNamespaces.S11NamespaceUrl);

            envelopElement.AppendChild(headerElement);

            var bodyElement = xmlDocument.CreateElement(CfdiDescargaMasivaNamespaces.S11Prefix, "Body", CfdiDescargaMasivaNamespaces.S11NamespaceUrl);

            envelopElement.AppendChild(bodyElement);

            var verificaSolicitudDescargaElement = xmlDocument.CreateElement(CfdiDescargaMasivaNamespaces.DesPrefix, "VerificaSolicitudDescarga", CfdiDescargaMasivaNamespaces.DesNamespaceUrl);

            bodyElement.AppendChild(verificaSolicitudDescargaElement);

            var solicitudElement = xmlDocument.CreateElement(CfdiDescargaMasivaNamespaces.DesPrefix, "solicitud", CfdiDescargaMasivaNamespaces.DesNamespaceUrl);

            solicitudElement.SetAttribute("IdSolicitud", verificacionRequest.RequestId);
            solicitudElement.SetAttribute("RfcSolicitante", verificacionRequest.RequestingRfc);

            var signatureElement = SignedXmlHelper.SignRequest(solicitudElement, certificate);

            solicitudElement.AppendChild(signatureElement);
            verificaSolicitudDescargaElement.AppendChild(solicitudElement);

            return(xmlDocument.OuterXml);
        }
        public GenericResponse <VerificacionResponse> VerificarUsuario(VerificacionRequest verificacionRequest)
        {
            string Url        = "https://backcargas.herokuapp.com";
            string controller = "verify";

            return(base.Post <VerificacionResponse>(Url, controller, verificacionRequest));
        }
Пример #3
0
        public async Task <ActionResult <Usuario> > VerificarRegistro([FromBody] VerificacionRequest verificacion)
        {
            Cliente cliente = modelo.VerificarProspecto(verificacion.codigoVerificacion);

            return(cliente);
        }