This web service searches the input text passed as a parameter for Field Fuzzy

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

Input Parameters

Input parameters to this Web Service API are:

  • Batch Class Identifier
  • Document Type Name
  • Index Field Name
  • Search Text

Sample for XML

private static void searchTextForFieldFuzzy() {

HttpClient client = new HttpClient();

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

PostMethod mPost = new PostMethod(url);

// adding file for sending

Part[] parts = new Part[5];

try {

parts[0] = new StringPart(“batchClassIdentifier”, “BC1”);

parts[1] = new StringPart(“documentTye”, “Invoice-Table”);

parts[2] = new StringPart(“searchText”, “*”);

parts[3] = new StringPart(“searchType”, “0”);

parts[4] = new StringPart(“fieldName”, “State”);

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

Comments are closed.