This API helps to decrypt the HOCR file present in batch instance folder created during batch processing on the input image. When a batch is run for an encrypted batch class, the HOCR files created for the image files are also encrypted, to decrypt the same decryptBatchInstanceHocrXML web service can be utilized.

Web Service URL: http://{serverName}:{port}/dcma/rest/decryptBatchInstanceHocrXml

Request Method: POST

Input Parameters

Input Parameter Value Description
hocrFileName An HOCR.xml file name to be decrypted File name must be a valid hocr file
batchInstanceIdentifier Batch instance identifier ( BI1) A valid batch instance identifier

Sample client code using apache commons http client:-

private static void decryptBatchInstanceHocrXml() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/decryptBatchInstanceHocrXml";
		PostMethod mPost = new PostMethod(url);
		Part[] parts = new Part[2];
		try {
			parts[0] = new StringPart("hocrFileName", "BI3_0_HOCR.xml");
			parts[1] = new StringPart("batchInstanceIdentifier", "BI3");
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("HOCR  XML decrypted successfully");
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
		} catch (FileNotFoundException e) {
			System.out.println("File not found for processing.");
		} catch (HttpException e) {
		} catch (IOException e) {
		} finally {
			if (mPost != null) {

Was this article helpful to you?


Comments are closed.