CancelRequest cancelRequest = new CancelRequest(true, cancelReason);
// Get the client connection and attempt the cancel.
ClientConnection clientConnection = operation.getClientConnection();
CancelResult cancelResult = clientConnection.cancelOperation(idToCancel,
cancelRequest);
// Update the result of the extended operation and return.
operation.setResultCode(cancelResult.getResultCode());
operation.appendErrorMessage(cancelResult.getResponseMessage());
}