The Republican-controlled House rejected a resolution ordering President Donald Trump to end the war in Iran.