Index: murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java
===================================================================
--- murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java	(revision 6bb4976f701c39d5dda50e34b68e158b4a59fd53)
+++ murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java	(revision aa8929092817bc7466fd168a44e3f6a175f9e3bb)
@@ -115,4 +115,5 @@
 
 import org.apache.log4j.Logger;
+import org.apache.tika.Tika;
 
 @Path("/archivos")
@@ -130,4 +131,10 @@
 	private static final String RSA_DIGEST_ENCRYPTION_ALGORITHM = "RSA";
 	
+	private final String DIGIDOC4J_CONFIGURATION = getAbsolutePathOfResource("digidoc4j.yaml");
+	
+	private final String DIGIDOC4J_TSL_LOCATION = "file://" + getAbsolutePathOfResource("venezuela-tsl.xml");
+	
+
+
 	// para reportes de advertencias de BDOC
 	private static boolean bdocWarnings = true;
@@ -360,4 +367,5 @@
 	 * @apiDescription Carga un archivo a través de un formulario y retorna un json con la información de la firma.
 	 * 
+	 * @apiSuccess {String} fileId Identificador único del archivo en el servidor
 	 * @apiSuccess {Boolean} fileExist El archivo se cargó exitosamente en el servidor.
 	 * @apiSuccess {String} error Extension not supported. En caso de que el archivo sea diferente de PDF y BDOC.
@@ -588,4 +596,6 @@
 		JSONObject jsonObject = new JSONObject();
 		
+		jsonObject.put("fileId", idFile);
+		
 		if (!tmpFile.exists()) {
 			System.out.println("File : " + file + " does not exists.");
@@ -597,5 +607,7 @@
 			jsonObject.put("fileExist", "true");
 			
-			String mime = getMimeType(file);
+			//String mime = getMimeType(file);
+			String mime = getMimeTypeWithTika(file);
+						
 			System.out.println("mimetype : " + mime);
 			
@@ -633,4 +645,8 @@
 		logger.debug("verifySignaturesInPdf: "+ pdfFile);
 		
+		java.nio.file.Path path = Paths.get(pdfFile);
+		String idFile = path.getFileName().toString();
+		
+		
 		JSONObject jsonSignatures = new JSONObject();
 		JSONArray jsonArray = new JSONArray();
@@ -644,9 +660,14 @@
 			ArrayList<String> names = af.getSignatureNames();
 			if (names.size() <= 0) {
-				jsonSignatures.put("signatureNumber", "0");
+				jsonSignatures.put("fileExist", "true");
+				jsonSignatures.put("fileId", idFile);
+				jsonSignatures.put("numberOfSignatures", "0");
+				jsonSignatures.put("mimeType", "application/pdf");
 			}else{
 				
 				jsonSignatures.put("fileExist", "true");
+				jsonSignatures.put("fileId", idFile);
 				jsonSignatures.put("numberOfSignatures", names.size());
+				jsonSignatures.put("mimeType", "application/pdf");
 								
 				HashMap<String, String> signatureInformation;
@@ -1514,4 +1535,5 @@
 	private JSONObject verifySignaturesInBdoc(String bdocFile) {
 	
+		System.out.println("verifySignaturesInBdoc(String bdocFile)");
 		JSONObject jsonSignatures = new JSONObject();
 
@@ -1519,13 +1541,36 @@
 		JSONArray jsonContainerValidationExceptionArray = new JSONArray();
 		
+		java.nio.file.Path path = Paths.get(bdocFile);
+		String idFile = path.getFileName().toString();
+		
+		
 		Security.addProvider(new BouncyCastleProvider());
-		Container container;
-		container = Container.open(bdocFile);
+		Container container = null;
+		
+		Configuration configuration = new Configuration(Configuration.Mode.PROD);
+		
+		configuration.loadConfiguration(DIGIDOC4J_CONFIGURATION);
+		
+		configuration.setTslLocation(DIGIDOC4J_TSL_LOCATION);
+		try
+		{
+			container = Container.open(bdocFile, configuration);
+		} catch(DigiDoc4JException e) 
+		{
+			jsonSignatures.put("error", "File is not a valid BDOC container");
+			return jsonSignatures;
+		}
+		
 		
 		int numberOfSignatures = container.getSignatures().size();
 		if (numberOfSignatures == 0){
 			jsonSignatures.put("signatureNumber", "0");
+			System.out.println("signatureNumber: 0");
 		}else{
 			jsonSignatures.put("fileExist", "true");
+			System.out.println("fileExist: true");
+			
+			jsonSignatures.put("fileId", idFile);
+			jsonSignatures.put("mimeType", "application/pdf");
 			
 			// informacion de archivos dentro del contenedor
@@ -2276,8 +2321,9 @@
 		Security.addProvider(new BouncyCastleProvider());
 		
-		Configuration configuration = new Configuration(Configuration.Mode.TEST);
-		
-		configuration.loadConfiguration("/home/aaraujo/desarrollo/2015/workspace-luna/JAXRS-Murachi/WebContent/WEB-INF/lib/digidoc4j.yaml");
-		configuration.setTslLocation("http://localhost/trusted-test-mp.xml");
+		Configuration configuration = new Configuration(Configuration.Mode.PROD);
+		
+		configuration.loadConfiguration("/tmp/digidoc4j.yaml");
+		//configuration.setTslLocation("http://localhost/trusted-test-mp.xml");
+		configuration.setTslLocation("file:///tmp/venezuela-tsl.xml");
 		
 	    Container container = Container.create(configuration);
@@ -2289,6 +2335,6 @@
 	    container.setSignatureParameters(signatureParameters);
 	    container.setSignatureProfile(SignatureProfile.B_BES);
-	    container.addDataFile("/tmp/01311213-5756-4707-a73d-6d42b09b26fd", "text/plain");
-	    container.sign(new PKCS12Signer("/tmp/JuanHilario.p12", "123456".toCharArray()));
+	    container.addDataFile("/tmp/salida.txt", "text/plain");
+	    container.sign(new PKCS12Signer("/tmp/tibisay.p12", "123456".toCharArray()));
 //	    Container container = Container.open("util/faulty/bdoc21-bad-nonce-content.bdoc");
 	    container.save("/tmp/signed.bdoc");
@@ -2572,4 +2618,36 @@
 		return result;		 
 	}
+	
+	/**
+	 * Retorna el mimeType del archivo pasado como argumento
+	 * @param absolutFilePath ruta absoluta del archivo
+	 * @return mimeType del archivo pasado como argumento
+	 */
+	public String getMimeTypeWithTika(String absolutFilePath) {
+				
+		String mimeType = "";		
+		
+		Tika tika = new Tika();
+		File file = new File(absolutFilePath);
+		try {
+			mimeType = tika.detect(file);
+		} catch (IOException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		
+		/*
+		java.nio.file.Path source = Paths.get(absolutFilePath);
+		try {
+			result = Files.probeContentType(source);			
+			System.out.println(result);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		*/		
+		return mimeType;		 
+	}
+	
 	
 	/**
