VirtualXML VirtualXML_ProcesaDocumento Method VirtualXML
Procesa un documento ( Firmado y Sellado para CFD ) ó ( Firmado, Sellado y Timbrado para CFDI )

Namespace: VirtualXML®
Assembly: VirtualXML_Doc (in VirtualXML_Doc.exe) Version: 1.0.0.0 (1.0.0.0)
Sintaxis

public static int VirtualXML_ProcesaDocumento(
	int hXml,
	string csd,
	string key,
	string keypwd,
	string outfile
)

Return Value

Tipo: Int32

Field Value

Tipo: Int32
0 // VIRTUALXML_OK Todo Bien

Field Value

Tipo: Int32
-1 // VIRTUALXML_ERROR_UNKVER Version desconocidad, validas 2.0,2.2,3.0,3.2

Field Value

Tipo: Int32
-2 // VIRTUALXML_ERROR_VALIDA Error de validacion del xml

Field Value

Tipo: Int32
-3 // VIRTUALXML_ERROR_CSDOPEN Error de apertura del archivo .cer - CSD ( Certificado de sello digital )

Field Value

Tipo: Int32
-4 // VIRTUALXML_ERROR_CSDRFC El rfc del certifcado no corresponde con el de la licencia o del xml

Field Value

Tipo: Int32
-5 // VIRTUALXML_ERROR_CSDFECHA La fecha del xml esta fuera de la vigencia del certificado

Field Value

Tipo: Int32
-6 // VIRTUALXML_ERROR_KEYOPEN Error de apertura del archivo key - clave privada

Field Value

Tipo: Int32
-7 // VIRTUALXML_ERROR_KEYPWD Error en el password del archivo key

Field Value

Tipo: Int32
-8 // VIRTUALXML_ERROR_CSDKEYMACTH El certificado ( CSD ) no es par del key ( llave privada )

Field Value

Tipo: Int32
-9 // VIRTUALXML_ERROR_CADENAPIPA Error en la generacion de la cadena origina

Field Value

Tipo: Int32
-10 // VIRTUALXML_ERROR_WS Error generico de conexion con el WS

Field Value

Tipo: Int32
-11 // VIRTUALXML_ERROR_NET Error de conexion a nivel local

Field Value

Tipo: Int32
-12 // VIRTUALXML_ERROR_SERVER La conexion al WS fue exitosa, pero existe algun error en el contenido

Field Value

Tipo: Int32
-13 // VIRTUALXML_ERROR_LICINV Error de licencia de CiberSAT invalida

Field Value

Tipo: Int32
-14 // VIRTUALXML_ERROR_MSXML El componente MSXML de microsoft no se encuentra instalado

Field Value

Tipo: Int32
-15 // VIRTUALXML_ERROR_GENSOAP Error en la generacion del soap

Field Value

Tipo: Int32
-16 // VIRTUALXML_ERROR_SETPAC Error en los datos de coneccion al PAC
Examples

private void GeneraDocto(String version)
{
    // Creamos un comprobante 
    int hXml = VirtualXML_New(version);

    // Llenado del documento 
    // .... 

    // Procesamiento del documento 
    int nResult = VirtualXML_ProcesaDocumento( hXml, "c:/ruta/csd.cer", "c:/ruta/llavePrivada.key", "passwordLlavePrivada", "c:/ruta/salida.xml" );

    if ( nResult != 0 )
    {
        // Ocurrio un Error, mostramos el valor 1 y 2
        VirtualXML_ShowError( hXml, 1 );    // Error en modo texto
        VirtualXML_ShowError( hXml, 2 );    // Descripcion detallada del Error
    }
    else
    {
        // Lectura de resultados 
        // ....
    }

    // Liberacion de memoria
    VirtualXML_Free(hXml);
}
Vease Tambien