Ejemplo WSMTXCA en Visual Basic para solicitar CAE anticipado
Este ejemplo usa la versión 8.5 (o superior) del instalador.
Es totalmente operativo ( pero es necesario leer toda la documentación del WSMTXCA para una implementación real.
Dim fe As New WSAFIPFE.Factura
If fe.iniciar(0, "CUIT sin separador", "ruta y nombre del certificado *.pfx", "") Then
If fe.fxObtenerTicketAcceso() Then
fe.ArchivoXMLRecibido = "c:\recibido.xml"
If fe.fxSolicitarCAEA(201012, 1) Then
MsgBox "CAE anticipado " + fe.fxRespuestaCAEA
MsgBox "Vencimiento " + fe.fxRespuestaCAEAFechaHasta
Else
MsgBox "fallo solicitar " + fe.fxErrorMsg1
If fe.fxErrorCode1 = 604 Then
If fe.fxConsultarCAEA(201012, 1) Then
MsgBox "CAE anticipado ya solicitado " + fe.fxRespuestaCAEA
MsgBox "Vencimiento " + fe.fxRespuestaCAEAFechaHasta
End If
End If
End If
Else
MsgBox "fallo acceso " + fe.UltimoMensajeError
End If
Else
MsgBox "fallo iniciar " + fe.UltimoMensajeError
End If