Index: murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java
===================================================================
--- murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java	(revision 34d85b6f6342c251054d3d137c0ae226da240ae4)
+++ murachi/src/main/java/ve/gob/cenditel/murachi/MurachiRESTWS.java	(revision a93a57cc07712ef070e0eedc0e3bb5a65dbd65ca)
@@ -2257,12 +2257,23 @@
 		logger.info("/bdocs/archivos/"+containerId);
 								
-		String fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId + ".bin";
-		logger.debug(fullPathBdocFile);
-		
-		
+		String fullPathBdocFile = "";
+		Boolean bdoc = false;
+		
+		if (containerId.endsWith(".bdoc"))
+		{
+			fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId;
+			logger.debug(fullPathBdocFile);
+			bdoc = true;
+		}
+		else
+		{
+			fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId + "-serialized.bin";
+			logger.debug(fullPathBdocFile);
+		}
+						
 		JSONObject json = new JSONObject();
 		int dataFileNumber = 0;
 		
-		Response response;
+		Response response = null;
 				
 		// Retrieve the file
@@ -2278,7 +2289,8 @@
 			Container c;
 			
-			try {
-				c = deserialize(fullPathBdocFile);
-				
+			if (bdoc)
+			{
+				c = Container.open(fullPathBdocFile, configuration);
+				logger.debug("open container: "+ fullPathBdocFile);
 				dataFileNumber = c.getDataFiles().size();
 				logger.debug("dataFileNumber: "+ Integer.toString(dataFileNumber));
@@ -2286,18 +2298,32 @@
 				
 				response = Response.status(200).entity(json.toString()).build();
-				
-			} catch (ClassNotFoundException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				
-				json.put("error", "error interno al leer el contenedor");				
-				response = Response.status(500).entity(json.toString()).build();
-
-			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				json.put("error", "no se pudo leer el contenedor");				
-				response = Response.status(500).entity(json.toString()).build();
-			}										    	
+			}
+			else
+			{
+				try {
+					c = deserialize(fullPathBdocFile);
+					
+					dataFileNumber = c.getDataFiles().size();
+					logger.debug("dataFileNumber: "+ Integer.toString(dataFileNumber));
+					json.put("dataFileNumber", Integer.toString(dataFileNumber));
+					
+					response = Response.status(200).entity(json.toString()).build();
+					
+				} catch (ClassNotFoundException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+					
+					json.put("error", "error interno al leer el contenedor");				
+					response = Response.status(500).entity(json.toString()).build();
+
+				} catch (IOException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+					json.put("error", "no se pudo leer el contenedor");				
+					response = Response.status(500).entity(json.toString()).build();
+				}
+			}
+			
+										    	
 	    } else {
 	    	logger.error("El contenedor con id: "+containerId+ " no existe.");
@@ -2323,7 +2349,22 @@
 		logger.info("/bdocs/archivos/lista/"+containerId);
 		
-		String fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId + ".bin";
-		logger.debug(fullPathBdocFile);
-		
+		//String fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId + ".bin";
+		//logger.debug(fullPathBdocFile);
+		
+		String fullPathBdocFile = "";
+		Boolean bdoc = false;
+		
+		if (containerId.endsWith(".bdoc"))
+		{
+			fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId;
+			logger.debug(fullPathBdocFile);
+			bdoc = true;
+		}
+		else
+		{
+			fullPathBdocFile = SERVER_UPLOAD_LOCATION_FOLDER + containerId + "-serialized.bin";
+			logger.debug(fullPathBdocFile);
+		}
+			
 		JSONObject jsonDataFile = new JSONObject();
 		int dataFileNumber = 0;
@@ -2341,48 +2382,64 @@
 			configuration.setTslLocation(DIGIDOC4J_TSL_LOCATION);
 		
-			Container c;
+			Container c = null;
 			String dataFileName = "";
 			Long dataFileSize = (long) 0;
 			
-			try {
-				c = deserialize(fullPathBdocFile);
-				
-				dataFileNumber = c.getDataFiles().size();
-								
-				if (dataFileNumber > 0)
+			
+			if (bdoc)
+			{
+				c = Container.open(fullPathBdocFile, configuration);		
+				logger.debug("contenedor abierto: " + fullPathBdocFile);
+			}
+			else
+			{
+				try {
+					c = deserialize(fullPathBdocFile);
+					logger.debug("contenedor deserializado: " + fullPathBdocFile);
+					
+				} catch (ClassNotFoundException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+					
+					jsonDataFile.put("error", "error interno al leer el contenedor");				
+					response = Response.status(500).entity(jsonDataFile.toString()).build();
+					return response;
+
+				} catch (IOException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+					jsonDataFile.put("error", "no se pudo leer el contenedor");				
+					response = Response.status(500).entity(jsonDataFile.toString()).build();
+					return response;
+				}
+				
+			}
+			
+			dataFileNumber = c.getDataFiles().size();
+			logger.debug("dataFileNumber: " + Integer.toString(dataFileNumber));
+			
+			if (dataFileNumber > 0)
+			{
+				for (int i=0; i<dataFileNumber; i++)
 				{
-					for (int i=0; i<dataFileNumber; i++)
-					{
-						// el dataFile es valido
-						DataFile df = c.getDataFile(i);
-						dataFileName = df.getName();
-						dataFileSize = df.getFileSize();
-						logger.debug("obtenido DataFile: "+Integer.toString(i));
-						logger.debug("DataFile name: "+ dataFileName);
-						logger.debug("DataFile size: "+ Long.toString(dataFileSize));
-					}
-					jsonDataFile.put("dataFiles", getJSONFromBDOCDataFiles(c.getDataFiles()));
-					response = Response.status(200).entity(jsonDataFile.toString()).build();
+					// el dataFile es valido
+					DataFile df = c.getDataFile(i);
+					dataFileName = df.getName();
+					dataFileSize = df.getFileSize();
+					logger.debug("obtenido DataFile: "+Integer.toString(i));
+					logger.debug("DataFile name: "+ dataFileName);
+					logger.debug("DataFile size: "+ Long.toString(dataFileSize));
 				}
-				else
-				{
-					logger.debug("dataFileNumber: "+ Integer.toString(dataFileNumber));
-					jsonDataFile.put("dataFileNumber", Integer.toString(dataFileNumber));
-					response = Response.status(200).entity(jsonDataFile.toString()).build();
-				}				
-				
-			} catch (ClassNotFoundException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				
-				jsonDataFile.put("error", "error interno al leer el contenedor");				
-				response = Response.status(500).entity(jsonDataFile.toString()).build();
-
-			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				jsonDataFile.put("error", "no se pudo leer el contenedor");				
-				response = Response.status(500).entity(jsonDataFile.toString()).build();
-			}										    	
+				jsonDataFile.put("dataFiles", getJSONFromBDOCDataFiles(c.getDataFiles()));
+				response = Response.status(200).entity(jsonDataFile.toString()).build();
+			}
+			else
+			{
+				logger.debug("dataFileNumber: "+ Integer.toString(dataFileNumber));
+				jsonDataFile.put("dataFileNumber", Integer.toString(dataFileNumber));
+				response = Response.status(200).entity(jsonDataFile.toString()).build();
+			}		
+			
+													    	
 	    } else {
 	    	logger.error("El contenedor con id: "+containerId+ " no existe.");
@@ -2452,6 +2509,26 @@
 			configuration.setTslLocation(DIGIDOC4J_TSL_LOCATION);
 		
-			container = Container.open(fullPathBdocFile, configuration);
-			logger.debug("open container: "+ fullPathBdocFile);
+			if (containerId.endsWith(".bdoc"))
+			{
+				container = Container.open(fullPathBdocFile, configuration);
+				logger.debug("open container: "+ fullPathBdocFile);
+			}
+			else
+			{
+				try {
+					container = deserialize(fullPathBdocFile + "-serialized.bin");
+				} catch (ClassNotFoundException e) {
+
+					//e.printStackTrace();
+					response = Response.status(500).entity("{\"error\": \"no se pudo leer el contenido del contenedor\"}").type("text/plain").build();
+					logger.error("no se pudo deserializar el contenedor para leer su contenido");
+				}
+				catch (IOException e) {
+
+					//e.printStackTrace();
+					response = Response.status(500).entity("{\"error\": \"no se pudo leer el contenido del contenedor\"}").type("text/plain").build();
+					logger.error("no se pudo deserializar el contenedor para leer su contenido");
+				}
+			}
 			
 			int dfSize = container.getDataFiles().size();
