The performance was long rehearsed in both Washington and Beijing, because both governments needed at least the appearance of a successful visit. China’s ruling Communist Party needed Obama’s unequivocal endorsement of China’s increasingly important international role in order to buttress its domestic legitimacy.