58 lines
2.3 KiB
Plaintext
Executable File
58 lines
2.3 KiB
Plaintext
Executable File
package com.fp.webservices.snap.seguridad;
|
|
|
|
|
|
/**
|
|
* Susbsecretaria de Gobierno Electrónico
|
|
* Elaborado por : Ing.Luiggi Andrade
|
|
*/
|
|
public class RegistroCivilClient
|
|
{
|
|
|
|
//@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/bsg.gob.ec/sw/RC/BSGSW01_Consultar_Cedula.wsdl")
|
|
// private static WSRegistroCivilConsultaCedula_Service service = new WSRegistroCivilConsultaCedula_Service();
|
|
|
|
public static void main(String[] args) {
|
|
PermissionClient permissionClient = new PermissionClient("https://www.bsg.gob.ec/sw/RC/BSGSW01_Consultar_Cedula?wsdl");
|
|
try { // Call Web Service Operation
|
|
|
|
DatosHeader headers= new DatosHeader();
|
|
|
|
//AuxValidarPermisoRespuesta validarPermiso = new AuxValidarPermisoRespuesta();
|
|
headers = permissionClient.generaToken();
|
|
|
|
//DatosHeader headerData = new DatosHeader();
|
|
|
|
//headerData.setDigest(DatosHeader.getDigest());
|
|
//headerData.setNonce(validarPermiso.getNonce());
|
|
//headerData.setFecha(validarPermiso.getFecha());
|
|
//headerData.setFechaf(validarPermiso.getFechaF());
|
|
ec.gob.registrocivil.consultacedula.WSRegistroCivilConsultaCedula_Service service = new ec.gob.registrocivil.consultacedula.WSRegistroCivilConsultaCedula_Service();
|
|
|
|
HeaderHandlerResolver handlerResolver = new HeaderHandlerResolver(headers);
|
|
service.setHandlerResolver(handlerResolver);
|
|
|
|
ec.gob.registrocivil.consultacedula.WSRegistroCivilConsultaCedula port = service.getWSRegistroCivilConsultaCedulaPort();
|
|
System.out.println(" --- >> >");
|
|
// TODO initialize WS operation arguments here
|
|
java.lang.String cedula = "1001114840";
|
|
java.lang.String usuario = "testroot";
|
|
java.lang.String contrasenia = "Sti1DigS21";
|
|
// TODO process result here
|
|
ec.gob.registrocivil.consultacedula.Cedula result = port.busquedaPorCedula(cedula, usuario, contrasenia);
|
|
System.out.println("Result = " + result.getNombre());
|
|
|
|
|
|
} catch (Exception ex) {
|
|
// TODO handle custom exceptions here
|
|
System.out.println(" --> "+ex.getMessage());
|
|
ex.printStackTrace();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|