I am using this project ( link ) to make the electronic signature with a webservice, but at the time of testing it does nothing.
XAdESBESSignature.firmar(input_file_path, key_store_path, key_store_password, output_path, out_file_name)
Receives several parameters, how to send files for the files as the certificate, I send it from a URl of a host, but I do not know if the web service is working or not with the signature because it does not return anything, in the end it generate a file already signed electronically with XADESBES
@WebMethod(operationName = "FirmaElectronica")
public String hello(@WebParam(name = "XML") String txt,@WebParam(name = "carpeta") String carpeta) {
//externo
String pathSignature = "http://[URL].com/archivos/firma.p12";
String passSignature = "xxxx";
//String xmlPath = "http://[URL].com/archivos/0102201801019041192300110010010000000031234567811.xml";
String xmlPath = txt;
String pathOut = carpeta;
String nameFileOut = "firmado.xml";
System.out.println("Ruta del XML de entrada: " + xmlPath);
System.out.println("Ruta Certificado: " + pathSignature);
System.out.println("Clave del Certificado: " + passSignature);
System.out.println("Ruta de salida del XML: " + pathOut);
System.out.println("Nombre del archivo salido: " + nameFileOut);
File folder =new File(carpeta);
if(!folder.exists()){
return "no existe la carpeta";
}
try{
XAdESBESSignature.firmar(xmlPath, pathSignature, passSignature, pathOut, nameFileOut);
}catch(IOException | CertificateException e){
System.out.println("Error: " + e);
}
return "Hello " + txt + " !";
}
From SOAPUI the web service works well