Israel's army is preparing to seal off the occupied West Bank after soldiers shot and killed two men who the military says launched an attack on civilians.