Barack Obama is criticised by electoral rival John McCain for cancelling a visit to injured US soldiers in Germany.