meta data de esta página
  •  

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
cargacertificado [2024/05/20 16:47]
172.16.70.86 se ha restaurado la vieja versión (2023/07/04 04:32)
cargacertificado [2025/12/24 02:38] (actual)
57.141.16.27 se ha restaurado la vieja versión (2025/09/05 19:22)
Línea 1: Línea 1:
-====== Método CargaCertificado() ====== +Carga certifdicadp
- +
-[[manual_de_integracion_obj|{{ :60577.png?30x30}}]] +
- +
-El request del método es el siguiente: +
- +
-| Request: Parámetro a enviar ||| +
-^ **Tipo** ^ **Identificador** ^ **Descripción** ^ +
-| String | Password | Proporcionado por The Factory HKA. | +
-| String | RUC | Proporcionado por el cliente. | +
-| String | Usuario | Proporcionado por The Factory HKA. | +
-| String | Certificado | Proporcionado por The Factory HKA. | +
-| String | Clave Certificado | Proporcionado por The Factory HKA. | +
- +
----- +
- +
-== XML EJEMPLO == +
- +
-<code xml> +
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:wsec="http://schemas.datacontract.org/2004/07/WSEcuadorService.Request"> +
-   <soapenv:Header/> +
-   <soapenv:Body> +
-      <tem:CargaCertificado> +
-         <!--Optional:--> +
-         <tem:data> +
-            <!--Optional:--> +
-            <wsec:Clave>?</wsec:Clave> +
-            <!--Optional:--> +
-            <wsec:RUC>?</wsec:RUC> +
-            <!--Optional:--> +
-            <wsec:Usuario>?</wsec:Usuario> +
-            <!--Optional:--> +
-            <wsec:Certificado>?</wsec:Certificado> +
-            <!--Optional:--> +
-            <wsec:ClaveCertificado>?</wsec:ClaveCertificado> +
-            <!--Optional:--> +
-            <wsec:Extension>?</wsec:Extension> +
-         </tem:data> +
-      </tem:CargaCertificado> +
-   </soapenv:Body> +
-</soapenv:Envelope> +
-</code> +
- +
----- +
-=== Proceso para consumo CargaCertificado === +
- +
-  * Se inicializa un objeto ServiceClient o Servicio +
-  * Se inicializa un objeto PeticionCargaCertificado donde se ingresan el RUC, el usuario de Integración ,clave de Integración y Documento +
-  * Se hace consumo del método CargaCertificado contenido en el objeto serviceClient y se coloca como parámetro la petición anterior, la respuesta estará contenida en un objeto llamado, la respuesta tendrá los parámetros Código y Mensaje // // +
- +
-<code csharp Codigo Ejemplo .NET> +
- +
-         try +
-         { +
-                ServiceClient serv = new ServiceClient(); +
-                PeticionCargaCertificado pet = new PeticionCargaCertificado(); +
-                pet.RUC = textBox2.Text; +
-                pet.Usuario = textBox3.Text; +
-                pet.Clave = textBox4.Text; +
-                string ext = textBox1.Text; +
- +
-                if (ext.Contains(".p12")) +
-                { +
-                    pet.Extension = "p12"; +
-                } +
-                if (ext.Contains(".pfx")) +
-                { +
-                    pet.Extension = "pfx"; +
-                } +
- +
-                byte[] a = File.ReadAllBytes(textBox1.Text);  //convertimos el certificado en base64 +
-                string CertConv = Convert.ToBase64String(a); +
-                byte[] b = Encoding.ASCII.GetBytes(textBox5.Text); +
-                pet.Certificado = CertConv; +
-                pet.ClaveCertificado = Convert.ToBase64String(b); +
- +
-                var resp = serv.CargaCertificado(pet); +
- +
-                richTextBox1.Text = "Código: " + resp.Codigo + "\r\n" + "Mensaje: " + "\r\n" + resp.Mensaje + "\r\n" + resp.FechaVigenciaInicio + "\r\n" + resp.FechaVigenciaFin + "\r\n" + resp.RUC; +
-            } +
-            catch (Exception ex) +
-            { +
- +
-                MessageBox.Show("Mensaje error: " + ex); +
-            } +
-</code> +
- +
-**El campo "Certificado" Y "ClaveCertificado" deben ser expresados en Base64** +
- +
-----+
  
 [[manual_de_integracion_obj|{{:60577.png?30x30 }}]] [[manual_de_integracion_obj|{{:60577.png?30x30 }}]]
- 
-----