package com.fp.frontend.webservices.snap.cedula;

import com.fp.common.logger.APPLogger;

import ec.gob.registrocivil.consultacedula.Cedula;

/**
 * Clase que realiza consultas al WS de la SNAP del registro civil
 *
 * @author dcruz
 *
 */
public class ClienteCedula {

    /**
     * Retorna los datos de la persona en base su numero de c&eacute;dula
     *
     * @param cedula
     * @return
     */
    public static Cedula obtenerCedula(String cedula) {
        Cedula cedulaResult = null;
        try {
            CedulaServicioService cedulaServicioService = new CedulaServicioService();
            cedulaResult = cedulaServicioService.getCedulaServicioPort().consultarCedula(cedula);
        } catch (Throwable e) {
            System.err.println("ERROR " + e);
            e.printStackTrace(System.err);
        }
        return cedulaResult;
    }

    public static void main(String[] args) {
        Cedula ced = obtenerCedula("1715060073");
        System.out.println("   .. " + ced);
        System.out.println("   .. " + ced.getNombre());
        System.out.println("   .. " + ced.getCalleDomicilio());
    }

}
