US President Donald Trump has pledged a strong military response after Iran's missile attack on American forces, escalating tensions in the Middle East despite ongoing diplomatic talks.