This API is used to get the roles specified for the particular batch class with name given in the input parameter.

Request Method GET

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

 

Input Parameter Values Descriptions
identifier This value should not be empty and valid batch class identifier. This parameter is used for identifying which batch class roles to be fetched.

 

CheckList:-

  1. Identifier should be a valid batch class identifier.

Sample client code using apache commons http client:-

private static void getRoles() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/getRoles/BC1";
		GetMethod mGet = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(mGet);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = mGet.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(mGet.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (mGet != null) {
				mGet.releaseConnection();
			}
		}
	}

Was this article helpful to you?

Engineering

Comments are closed.