Configuration config = null;
if (tokens.length > 2)
config = createConfigurationFromString(tokens[2]);
OperationServicesResult res = operationServices.invokeOperation(operationContext, tokens[1], config, 2000);
if (res.getResultCode() == OperationServicesResultCode.FAILURE) {
System.err.println("Failure executing the operation: \n" + res.getErrorStackTrace());
} else if (res.getResultCode() == OperationServicesResultCode.TIMED_OUT) {
System.err.println("Operation timed out ");
} else if (res.getResultCode() == OperationServicesResultCode.CANCELED) {
System.err.println("Operation was canceled ");
} else {
Configuration result = res.getComplexResults();
if (result == null)
System.out.println("Operation did not return a result");
else
System.out.println(result.getProperties());
}