This API helps to decrypt the batch xml file present in the final drop folder. The batch xml to be decrypted contains a key which is required for decrypting the same. This batch XML can only be decrypted on the server on which the batch was executed because of the uniqueness in the Signature which is determined by Ephesoft application in use

Request Method: POST

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

Sample client code using apache commons http client:-

private static void decryptBatchXml() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/decryptBatchXml";
		PostMethod mPost = new PostMethod(url);
		mPost.setDoAuthentication(true);
		File file1 = new File("F:\\Ephesoft\\SharedFolders\\BC5\\Final-drop-folder\\BI2\\BI2_batch.xml");
		Part[] parts = new Part[1];
		try {
			parts[0] = new FilePart(file1.getName(), file1);
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			mPost.setRequestEntity(entity);
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Batch XML decrypted successfully");
				System.out.println(mPost.getResponseBodyAsString());
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mPost.getResponseBodyAsString());
			}
		} catch (FileNotFoundException e) {
			System.out.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