A Palestinian gunman opened fire at Israeli soldiers on the outskirts of Ramallah in the occupied West Bank on Monday, wounding three of them before being shot dead, officials said.