private static final String HEIGHT = "INSERT_HEIGHT_HERE";
public static void runExample(
DfaServices dfaServices, DfaSession session, int width, int height) throws Exception {
// Request the size service from the service client factory.
SizeRemote sizeService = dfaServices.get(session, SizeRemote.class);
// Get size.
SizeSearchCriteria sizeSearchCriteria = new SizeSearchCriteria();
sizeSearchCriteria.setHeight(height);
sizeSearchCriteria.setWidth(width);
SizeRecordSet sizeRecordSet = sizeService.getSizes(sizeSearchCriteria);
// Display size ID.
if (sizeRecordSet.getRecords().length > 0) {
for (Size size: sizeRecordSet.getRecords()) {
System.out.printf("Size ID for \"%sx%s\" is \"%s\".%n", width, height, size.getId());