This web service extracts index fields as per the batch class configuration for Fuzzy DB. This takes into account both document level and field Fuzzy configuration.

Web Service URL: http://<HOSTNAME>:8080/dcma/rest/extractFieldsForFuzzyDB

Input Parameters

Input parameters to this Web Service API are:

  • Batch Class Identifier (Mandatory)
  • Document Type Name (Mandatory)
  • List of HOCR Page(s) (Optional)
  • List of Index Field Name
  • Index Field Value

 

Sample for XML

private static void extractFieldsForFuzzyDB() {

HttpClient client = new HttpClient();

String url = “http://localhost:8080/dcma/rest/extractFieldsForFuzzyDB“;

PostMethod mPost = new PostMethod(url);

// adding file for sending

File webServInputFile = new File(“C:\\sample\\FuzzyDBExtract_Input.xml”);

File hocrZipFile = new File(“C:\\sample\\HOCR_XML.zip”);

 

Part[] parts = new Part[2];

try {

parts[0] = new FilePart(webServInputFile.getName(), webServInputFile);

parts[1] = new FilePart(hocrZipFile.getName(), hocrZipFile);

 

MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());

mPost.setRequestEntity(entity);

int statusCode = client.executeMethod(mPost);

if (statusCode == 200) {

System.out.println(“Web service executed successfully.”);

String responseBody = mPost.getResponseBodyAsString();

// Generating result as responseBody.

System.out.println(statusCode + ” *** ” + responseBody);

else if (statusCode == 403) {

System.out.println(“Invalid username/password.”);

else {

System.out.println(mPost.getResponseBodyAsString());

}

catch (FileNotFoundException e) {

System.err.println(“File not found for processing.”);

catch (HttpException e) {

e.printStackTrace();

catch (IOException e) {

e.printStackTrace();

finally {

if (mPost != null) {

mPost.releaseConnection();

}

}

}

 

Was this article helpful to you?

Engineering