Visual Basic.NET - Existira una nueva forma de descarga masiva sat

 
Vista:
sin imagen de perfil
Val: 3
Ha aumentado su posición en 7 puestos en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

Existira una nueva forma de descarga masiva sat

Publicado por Agustin (6 intervenciones) el 24/04/2024 01:23:39
buenas tardes, para realizar la descarga del sat que ha anunciado se puede logra por medio de consumo web.service de sat que publica, pero la url https://cfdidescargamasiva.clouda.sat.gob.mx/DescargaMasivaService.svc no responde

Existe un proyecto conocido como sw-descargamasiva-dotnet quizas alguno ya lo vio, establece los parametros pero al final retorna el error: 301 Xml mal formado, por lo que hay un metodo Generate en para formar los parametros enviados de acuerdo a los cambios que hicieron, recurro a ustedes para preguntarles si ya pudieron integrarlo en su descarga facturacion recibida en donde se debe de enviar el rfc receptor como un elemento o en que estoy incorrecto.

Este es codigo que hice cambios y me regresa el error 301
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
public string Generate(X509Certificate2 certificate, string rfcEmisor, string rfcReceptor, string rfcSolicitante, string fechaInicial = "", string fechaFinal = "", string tipoSolicitud = "CFDI")
        {
            FixFecha(fechaInicial, fechaFinal, out fechaInicial, out fechaFinal);
            string canonicalTimestamp = "<des:SolicitaDescarga xmlns:des=\"http://DescargaMasivaTerceros.sat.gob.mx\">"
                + "<solicitud " + (rfcReceptor.Length > 0 ? "" : "RfcEmisor =\"" + rfcEmisor + "\"") + "RfcSolicitante=\"" + rfcSolicitante + "\" FechaInicial=\"" + fechaInicial + "\" FechaFinal=\"" + fechaFinal + "\" TipoSolicitud=\"CFDI\">"
                + (rfcReceptor.Length>0 ? "<RfcReceptores><RfcReceptor>" + rfcReceptor  + "</RfcReceptor></RfcReceptores>" : "")
                + "</solicitud>"
                + "</SolicitaDescarga>";
 
            string digest = CreateDigest(canonicalTimestamp);
 
            string canonicalSignedInfo = @"<SignedInfo xmlns=""http://www.w3.org/2000/09/xmldsig#"">" +
                                            @"<CanonicalizationMethod Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""></CanonicalizationMethod>" +
                                            @"<SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#rsa-sha1""></SignatureMethod>" +
                                            @"<Reference URI=""#_0"">" +
                                               "<Transforms>" +
                                                  @"<Transform Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""></Transform>" +
                                               "</Transforms>" +
                                               @"<DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1""></DigestMethod>" +
                                               "<DigestValue>" + digest + "</DigestValue>" +
                                            "</Reference>" +
                                         "</SignedInfo>";
            string signature = Sign(canonicalSignedInfo, certificate);
            string soap_request = @"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:u=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"" xmlns:des=""http://DescargaMasivaTerceros.sat.gob.mx"" xmlns:xd=""http://www.w3.org/2000/09/xmldsig#"">" +
                        @"<s:Header/>" +
                        @"<s:Body>" +
                            @"<SolicitaDescarga>" +
                                @"<solicitud " +
                                (rfcReceptor.Length>0 ? "" : @"""RfcEmisor =""" + rfcEmisor) +
                                @""" RfcSolicitante=""" + rfcSolicitante +
                                @""" FechaInicial=""" + fechaInicial +
                                @""" FechaFinal =""" + fechaFinal +
                                @""" TipoSolicitud=""" + tipoSolicitud +
                                @""">" + (rfcReceptor.Length > 0 ? "<RfcReceptores><RfcReceptor>" + rfcReceptor + "</RfcReceptor></RfcReceptores>" : "")
                                                 +  @"<Signature xmlns=""http://www.w3.org/2000/09/xmldsig#"">" +
                                                    @"<SignedInfo>" +
                                                    @"<CanonicalizationMethod Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""/>" +
                                                    @"<SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#rsa-sha1""/>" +
                                                    @"<Reference URI=""#_0"">" +
                                                        @"<Transforms>" +
                                                        @"<Transform Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""/>" +
                                                        @"</Transforms>" +
                                                        @"<DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1""/>" +
                                                        @"<DigestValue>" + digest + @"</DigestValue>" +
                                                    @"</Reference>" +
                                                    @"</SignedInfo>" +
                                                    @"<SignatureValue>" + signature + "</SignatureValue>" +
                                                    @"<KeyInfo>" +
                                                        @"<X509Data>" +
                                                            @"<X509IssuerSerial>" +
                                                                @"<X509IssuerName>" + certificate.Issuer +
                                                                @"</X509IssuerName>" +
                                                                @"<X509SerialNumber>" + certificate.SerialNumber +
                                                                @"</X509SerialNumber>" +
                                                            @"</X509IssuerSerial>" +
                                                            @"<X509Certificate>" + Convert.ToBase64String(certificate.RawData) + "</X509Certificate>" +
                                                        @"</X509Data>" +
                                                    @"</KeyInfo>" +
                                                    @"</Signature>" +
                                                    @"</solicitud>" +
                                                @"</SolicitaDescarga>" +
                                            @"</s:Body>" +
                                            @"</s:Envelope>";
            xml = soap_request;
            return soap_request;
        }


Haber si alguien ya paso por este caso, ya que al no responder la url de descarga entonces cual es la correcta.
muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder