The API helps to decrypt the HOCR file present in the test folders within the batch class. Test folders that can be used with the API can be:-

  1. test-advanced-extraction
  2. test-classification
  3. test-extraction
  4. test-table

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

Request Method: POST

Input Parameters

Input Parameter Value Description
hocrFileName A valid HOCR.xml file name to be decrypted File name must be a valid hocr file
batchClassIdentifier Batch class identifier ( BC1) A valid batch class identifier
  • table
  • extraction
  • classification
  • advanced-extraction
Test type is to be entered for the decryption of HOCR from any of the folders
documentType Document type present in the batch class A valid document type present in the batch class is expected


Sample client code using apache commons http client:-

private static void decryptTestHocrXml() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/decryptTestHocrXml";
		PostMethod mPost = new PostMethod(url);
		Part[] parts = new Part[4];
		try {
			parts[0] = new StringPart("hocrFileName", "US-Invoice-0000_HOCR.xml");
			parts[1] = new StringPart("batchClassIdentifier", "BC5");
			parts[2] = new StringPart("testType", "table");
			parts[3] = new StringPart("documentType", "US Invoice");
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("HOCR  XML decrypted successfully");
				String responseBody = mPost.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} 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.